I'm using AC for the various bits and bobs I need, but am rolling my own structure to the game, which involves asynchronously loading in-and-out scenes as they're needed.
the AC GameEngine stuff is in my core game scene with my main camera et al. Hit a bit of a stumbling block where:
1 - Load in Async scene containing AC cutscenes and hotspots and what-have-you.
2. - Unload Scene
3. - Reload scene
I get errors regarding SubScene, which I gather is created automatically so presumably there's a reference somewhere I need to null out. Any chance of a heads up on what to do here? Error below in case that's handy:
MissingReferenceException: The object of type 'SubScene' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
AC.UnityVersionHandler.GetLocalVariablesOfGameObject (UnityEngine.GameObject _gameObject) (at Assets/AdventureCreator/Scripts/Static/UnityVersionHandler.cs:243)
AC.ActionSpeech.AssignParentList (AC.ActionList actionList) (at Assets/AdventureCreator/Scripts/Actions/ActionSpeech.cs:93)
AC.ActionList+<RunAction>c__Iterator2.MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:318)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
Comments
I'd advise caution when tampering with the subScenes variable, as it's AC's way of keeping track of what additional scenes are open - and is necessary to successfully their loading when handling save game files.
Are you using the Scene: Add or remove Action to load/unload your scenes, or your own code?