issue with AdventureCreatorBridge EnforceCursor .MoveNext
Posted: Wed Jul 05, 2023 2:21 pm
Occasionally when loading a scene from the adventure creator save system, this error is being thrown. (Let me know if this is a question for the AC forums.)
The line it's pinging is
It's likely to do with this script I have that makes sure the cursor is enabled when you open the menu, and then checks if it needs to be turned on or off when it loads the save.
Is the adventure bridge being interfered with by my accessing the SetCursorSystem?
Code: Select all
NullReferenceException: Object reference not set to an instance of an object
PixelCrushers.DialogueSystem.AdventureCreatorSupport.AdventureCreatorBridge+<EnforceCursor>d__55.MoveNext () (at Assets/Pixel Crushers/Dialogue System/Third Party Support/Adventure Creator Support/Scripts/AdventureCreatorBridge.cs:401)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <d3b66f0ad4e34a55b6ef91ab84878193>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Code: Select all
KickStarter.playerInput.SetInGameCursorState(false);
Code: Select all
if (!value) // if pausing
{
if (AC.KickStarter.cursorManager.cursorDisplay == CursorDisplay.Never)
GlobalVariables.SetBooleanValue(40, false);
else
GlobalVariables.SetBooleanValue(40, true);
EnableCursor();
} else // if unpausing
{
if (GlobalVariables.GetBooleanValue(40) == true) // If cursor was enabled when we paused, keep it enabled
EnableCursor();
else // Otherwise, disable it again
DisableCursor();
}
Code: Select all
void EnableCursor()
{
AC.KickStarter.cursorManager.cursorDisplay = CursorDisplay.Always;
AC.PlayerMenus.GetElementWithName("Hotspot", "HotspotLabel").IsVisible = true;
AC.KickStarter.stateHandler.SetCursorSystem(true);
}