private void Start()
    {
        RefreshHeartUi();
        OnSceneChangeCallback += RearrangeObjectsBasedOnScene;
        OnSceneChangeCallback?.Invoke(false);

        onPlayerDieCallback += RefreshHeartUi;
    }
Example #2
0
        /// <summary>
        /// On game scene active
        /// </summary>
        private static void BSEvents_gameSceneActive()
        {
            ActiveScene = SceneType.Playing;

            if (OnSceneChange != null)
            {
                OnSceneChange.Invoke(ActiveScene);
            }
        }
Example #3
0
        ////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// On menu scene active
        /// </summary>
        private static void BSEvents_menuSceneActive()
        {
            ActiveScene = SceneType.Menu;

            if (OnSceneChange != null)
            {
                OnSceneChange.Invoke(ActiveScene);
            }
        }
Example #4
0
        private void ActiveSceneChanged(Scene oldScene, Scene newScene)
        {
            if (oldScene.name != null)
            {
                NestedScope.Save();
            }

            NestedScope = new T();

            OnSceneChange?.Invoke(NestedScope, newScene);
            (NestedScope as ScopePlayerPrefs)?.Setup(newScene.name);

            NestedScope.Init();
        }
Example #5
0
 internal void SceneChange(Scene scene)
 {
     OnSceneChange?.Invoke(this, new SceneEventArgs(scene));
 }
Example #6
0
 public void ChangeScene(int index)
 {
     OnSceneChange?.Invoke();
     SceneManager.LoadScene(index);
 }