Guest User

Untitled

a guest
Dec 17th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. //gets called on the local instance from the OnGameLoad, will only be called once obviously
  2. void Configure()
  3. {
  4. Debug.Log("Manager Configured, Called Once The Game Loads, Right Before The Scene Load");
  5.  
  6. SceneManager.sceneLoaded += OnSceneChanged;
  7. }
  8.  
  9. //listener to scene change event, calls the Init method
  10. private void OnSceneChanged(Scene scene, LoadSceneMode loadMode)
  11. {
  12. Init();
  13. }
  14.  
  15. //gets called on scene change, should act as a replacement for a monobehaviour's Awake, Start, .... methods
  16. void Init()
  17. {
  18. Debug.Log("Manager Initilized, Called On Every Scene Load Including The Startup Scene");
  19. }
Add Comment
Please, Sign In to add comment