Exemple #1
0
        public override IEnumerator PreEnter(Scene nextScene)
        {
            NMManager manager = NMManager.Instance;

            manager.effect.PreEnter();
            manager.input.PreEnter(CameraManager.Instance.GetCamera());

            Vector3 SpawnPoint = GameObject.FindGameObjectWithTag("SpawnPoint").transform.position;

            manager.character.PreEnter(manager.input, SpawnPoint);

            SceneManager.MoveGameObjectToScene(manager.character.player, nextScene);
            CameraManager.Instance.SetCameraActive(true);
            CameraManager.Instance.SetFollow(manager.character.player);

            // 현재씬에서 UI 효과 빼버림.
            NMUI.Instance.gameObject.SetActive(false);

            //SoundManager.instance.PreEnter();
            //SoundManager.instance.PlaySound(SoundManager.instance.inGameBGM, true);



            yield break;
        }
Exemple #2
0
        // 체크포인트 리스트업 할 것.
        public override IEnumerator PreEnter(Scene nextScene)
        {
            NMUI.Fade(0, 2);

            //인트로 사운트 페이트 아웃 시점
            SoundManager sounds = SoundManager.instance;

            sounds.FadeOutSound(sounds.introBGM);

            sounds.PlaySound(sounds.mainBGM);
            sounds.FadeInSound(sounds.mainBGM);

            string empty = null;

            NMUI.SetActiveParent("Game");


            //exitBtn = NMUI.GetUI<Button>("exit_btn");
            continueBtn = NMUI.GetUI <Button>("continue_btn");
            golobbyBtn  = NMUI.GetUI <Button>("golobby_btn");
            menu        = NMUI.GetUI <Transform>("exit_menu").gameObject;
            menu.SetActive(false);
            //exitBtn.onClick.RemoveAllListeners();
            //exitBtn.onClick.AddListener(ActiveMunu);

            NMManager manager = NMManager.Instance;

            manager.effect.PreEnter();
            manager.input.PreEnter(CameraManager.Instance.GetCamera());

            // 레벨에서 체크포인트 번호 가져와서 위치 세팅할 것.
            string sceneName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;

            PuzzleCheckPoint checkpoint = null;

            if (sceneName.Contains("Zone"))
            {
                LevelManager.CurLevel.Init();

                if (LevelManager.CurLevel.playData._zoneNumber != int.Parse(sceneName.Substring(4, 2)))
                {
                    Debug.LogWarning("ZoneNumber Not Matched!!!");
                }
                else
                {
                    checkpoint = LevelManager.CurLevel.GetCheckPoint();
                }
            }

            if (checkpoint != null)
            {
                manager.character.PreEnter(manager.input, checkpoint.transform.position);
            }
            else
            {
                GameObject startPoint = GameObject.FindGameObjectWithTag("SpawnPoint");
                if (null == startPoint)
                {
                    GameObject[] objs = nextScene.GetRootGameObjects();
                    for (int i = 0; i < objs.Length; i++)
                    {
                        if (objs[i].name == "SpawnPoint")
                        {
                            startPoint = objs[i];
                            break;
                        }
                    }
                }
                if (null != startPoint)
                {
                    manager.character.PreEnter(manager.input, startPoint.transform.position);
                }
            }

            SceneManager.MoveGameObjectToScene(manager.character.player, nextScene);

            CameraManager.Instance.SetCameraActive(true);
            CameraManager.Instance.SetFollow(manager.character.player);
            yield break;
        }