Esempio n. 1
0
 void Awake()
 {
     // initialize the screen bounds cache
     _screenBounds.x = -1f;
     // do some setup after finishes all gameobject effects
     EffectPrioritizerHelper.registerAsEndEffect(this as IEffectListener);
     // setup the effects chain triggered before load next scene
     beforeNextScene = GetComponent <BeforeLoadNextScene>();
     if (beforeNextScene != null)
     {
         beforeNextScene.setScene(targetScene);
     }
 }
Esempio n. 2
0
 void Update()
 {
     if (isActivationValid())
     {
         if (beforeNextScene != null)
         {
             this.enabled = false;                 // avoid re execution of the before next scene effect
             beforeNextScene.setScene(LevelManager.Instance.getNextLevelEnum());
             beforeNextScene.execute();
         }
         else
         {
             LevelManager.Instance.loadNextLevel();
         }
     }
 }