Hey everybody!
I have a method that runs when a scene has been loaded (SceneManager.sceneLoaded += OnSceneLoaded;) and in this OnSceneLoaded method I'm running ActionLists that I reference in the inspector.
My problem is, the content of the actionlists seem to run (breakpoints work, comments work) but it doesn't change objects in the scene (in my case, the visibility and hotbox interactions don't change). Now I noticed that when I'm setting a breakpoint, the changes do work, which brings me to believe that the ActionLists are running too soon.
Is there a better event than SceneManager.sceneLoaded (Unity) for AC? A moment when I can be sure that everything has been loaded by AC?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
AC.EventManager.OnAfterChangeScene does the trick.
Yes, OnAfterChangeScene is the event to use here.
You can also rely on the Events Editor to handle this without scripting, however. The "Scene / Change / After" is the editor-equivalent of the above, which can then be set to run the ActionList asset directly.