Using Events
Last updated
Last updated
Connect events from Scene Flow Manager
Steps
Setup a working game flow follows the previous tutorials. We have a simple flow setup here.
2. Open the bootstrap scene. Select the Scene Flow Manager.
3. Add a new script and name it DemoEvents.cs ( You can use your own name or script).
4. Open the DemoEvents.cs and add functions called HandleLoadEvent() and HandleUnloadEvent().
5. From the inspector, open the events foldout and you will see a list of events.
6. Press the "+" button and add a new event under OnSceneLoaded event.
7. Drag and drop the Scene Flow Manager gameobject to the object field.
8. From the functions drop down, select the HandleLoadEvent() from the DemoEvents object.
9. Repeat the steps for OnSceneUnload event and HandleUnloadEvent() function.
10. Play the scene. You will see the events log in the console when you run the project.