示例#1
0
 public void OnPause()
 {
     lastSceneBuildIndex = SceneExtension.GetCurrentSceneBuildIndex();
     if (!SceneExtension.TrySwitchToScene(SceneExtension.MenuUiSceneName))
     {
         return;
     }
     _inputController.OnCancelEvent += OnCancelEventCalled;
     BackToPreviousPage();
     _isPaused = true;
 }
示例#2
0
        private IEnumerator Transition()
        {
            if (sceneToLoad < 0)
            {
                yield break;
            }

            DontDestroyOnLoad(gameObject);

            var buildIndex = SceneExtension.GetCurrentSceneBuildIndex();

            //FindObjectOfType<PlayerController>().enabled = false;
            yield return(SceneExtension.LoadMultiSceneWithBuildIndexSequence(sceneToLoad, true));

            //var player = FindObjectOfType<PlayerController>();
            //var cam = FindObjectOfType<PixelPerfectCamera>();
            //player.enabled = false;
            var otherPortal = GetOtherScenePortal(buildIndex);

            //UpdatePlayerSpawnPosition(otherPortal, player.gameObject, cam.gameObject);
            //player.enabled = true;

            Destroy(gameObject);
        }