Skip to Content
SDK Integration
UnityMigrating to 2.0

Migrating to Unity SDK 2.0

Version 2.0.0 is a breaking release. Scene-based setup, the NunuManager prefab, and the PacketLogger are gone: the SDK bootstraps itself, configuration moves into code, and we are using EldritchLink v5 (EL5).

Nexus keeps accepting both EL4 and EL5 connections for a while, so your existing 1.x builds keep working. Some newer features are v5-only

What changed

1.x2.0
NunuManager prefab dragged into a sceneNo prefab — the SDK bootstraps before the first scene loads
Configuration on the prefab’s inspectorNunuSdk.Configure(new NunuConfig { ... }) in code
Trailing required PacketLogger parameterRemoved — no logger parameter
logger.Log(...) with LogLevel / sendToAIUnityEngine.Debug.Log — logs auto-forwarded to game.log
Return bool to signal successReturn void; throw to signal failure
EldritchLink v4EldritchLink v5
SDK performance tracking + exception logger modulesRemoved (perf tracking now handled at the platform level, engine-independent)

Step 1 — Update the package

  1. Download the 2.0.0 release from Github (e.g. nunu-sdk-unity-2.0.0.tgz).
  2. In Unity, open Window > Package Manager, click +, and choose Add package from tarball…, selecting the new tarball. This replaces the old package in place.

Step 2 — Remove the prefab from your scenes

The SDK no longer uses a scene object. Delete the NunuManager prefab instance from every scene it was added to. Before you delete it, note any values you customized on its inspector (console hotkey, debug menu corner, whether the console / connection info UI was shown)

If you never changed the prefab’s defaults, you can skip Step 3 entirely (console + connection-status UI on, F7 hotkey, bottom-left mobile gesture corner).

Step 3 — Re-apply your configuration in code

If you customized the prefab, move those settings into a NunuSdk.Configure call from your startup code:

#if USE_NUNU_SDK using Nunu; using Nunu.Utils; using UnityEngine; public static class NunuMenuConfig { [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] private static void Configure() { NunuSdk.Configure(new NunuConfig { ConsoleHotkeys = new[] { new HotkeyCombo { PrimaryKey = KeyCode.F7, ModifierKeys = new[] { KeyCode.LeftShift } } }, DebugMenuCorner = DebugMenuCorner.BottomLeft, ShowConsole = true, ShowConnectionInfo = true }); } } #endif

Step 4 — Update your Flayer functions

Drop PacketLogger, use Debug.Log

The required trailing PacketLogger parameter is gone. Remove it from every handler and replace logger.Log(...) calls with UnityEngine.Debug. While the SDK is connected, Unity logs are automatically forwarded over EL5 to game.log, so you no longer send logs through a logger object. Also drop the old logging namespace import (using Nunu.Network.Logging;).

Map the old LogLevel argument onto the matching Debug call: LogLevel.WarningDebug.LogWarning, LogLevel.ErrorDebug.LogError, everything else → Debug.Log.

Return void, throw on failure

void is now a supported return type, so handlers that just perform an action no longer need a placeholder bool. And instead of logging an error and returning false, throw — the exception is returned to the caller as an EL5 Error frame, so the agent sees what went wrong. You no longer catch and report exceptions manually.

// Before (1.x) [FlayerFunction("open_inventory", "opens the character's inventory")] public static bool HandleOpenInventory(PacketLogger logger) { if (!inventory.CanOpen) { logger.Log("Cannot open inventory right now", LogLevel.Warning, sendToAI: true); return false; } inventory.Open(); return true; } // After (2.0) [FlayerFunction("open_inventory", "opens the character's inventory")] public static void HandleOpenInventory() { if (!inventory.CanOpen) throw new InvalidOperationException("Cannot open inventory right now"); inventory.Open(); }

Keep returning a value only when it’s genuinely meaningful

Step 5 — Rebuild and verify

Deep link and metadata configuration is still handled automatically by the post-build scripts (Android intent filters, iOS URL schemes, Windows .nunu.json), so no build-side changes are required beyond making sure USE_NUNU_SDK is defined for your dev builds. See Build Config.

Then run the game, open the console with F7, paste an EL5 connection string from the Flayer debugger, and confirm your Flayer functions register and respond.

Last updated on