示例#1
0
    IEnumerator LoaddingScene(string[] loadName = null, string[] unloadName = null)
    {
        AsyncOperation AO;

        int amount;

        if (unloadName == null)
        {
            amount = 0;
        }
        else
        {
            amount = unloadName.Length;
        }
        _curStateLoading = eLoadingState.START;
        // Unload 실행.
        _curStateLoading = eLoadingState.UNLOADING;
        for (int i = 0; i < amount; i++)
        {
            AO = SceneManager.UnloadSceneAsync(unloadName[i]);
            while (!AO.isDone)
            {
                yield return(null);
            }
            yield return(new WaitForSeconds(1));
        }

        _curStateLoading = eLoadingState.LOADING;
        // Load 실행.
        if (loadName == null)
        {
            amount = 0;
        }
        else
        {
            amount = loadName.Length;
        }
        for (int i = 0; i < amount; i++)
        {
            AO = SceneManager.LoadSceneAsync(loadName[i], LoadSceneMode.Additive);
            while (!AO.isDone)
            {
                yield return(null);
            }
            yield return(new WaitForSeconds(1));
        }
        SceneManager.SetActiveScene(SceneManager.GetSceneByName(loadName[amount - 1]));

        // BGM 사운드
        if (_curStage == eStageState.LOBBY)
        {
            SoundManager._uniqueinstance.PlayBGMSound(SoundManager.eBGMType.LOBBY, SoundManager._uniqueinstance.BGM.volume);
        }
        else if (_curStage == eStageState.INGAME)
        {
            SoundManager._uniqueinstance.PlayBGMSound(SoundManager.eBGMType.INGAME, SoundManager._uniqueinstance.BGM.volume);
        }

        _curStateLoading = eLoadingState.END;
    }
示例#2
0
    //void LateUpdate()
    //{
    //    if(LobbyManager._uniqueInstance.ACHIEVMENT)
    //    {
    //        _achievmentList.SetActive(true);
    //    }
    //    else
    //    {
    //        _achievmentList.SetActive(false);
    //    }
    //}

    public IEnumerator LoadingScene(string[] loadName = null, string[] unloadName = null)
    {
        AsyncOperation AO;

        int amount;

        if (unloadName == null)
        {
            amount = 0;
        }
        else
        {
            amount = unloadName.Length;
        }

        _curGameLoad = eLoadingState.UNLOADING;
        for (int n = 0; n < amount; n++)
        {
            AO = SceneManager.UnloadSceneAsync(unloadName[n]);
            while (!AO.isDone)
            {
                yield return(null);
            }
            yield return(new WaitForSeconds(1));
        }

        _curGameLoad = eLoadingState.LOADING;
        if (loadName == null)
        {
            amount = 0;
        }
        else
        {
            amount = loadName.Length;
        }

        for (int n = 0; n < amount; n++)
        {
            AO = SceneManager.LoadSceneAsync(loadName[n], LoadSceneMode.Additive);
            while (!AO.isDone)
            {
                yield return(null);
            }
            yield return(new WaitForSeconds(1));
        }
        SceneManager.SetActiveScene(SceneManager.GetSceneByName(loadName[amount - 1]));

        if (_curStage == eStageState.LOBBY)
        {
            SoundManager._uniqueInstance.PlayBGMSound(SoundManager.eBGMType.LOBBY);
        }
        else if (_curStage == eStageState.INGAME)
        {
            SoundManager._uniqueInstance.PlayBGMSound(SoundManager.eBGMType.INGAME);
        }

        _curGameLoad = eLoadingState.END;
    }
示例#3
0
    // Start is called before the first frame update
    void Start()
    {
        BaseSceneInstance = this;

        SceneManager.LoadSceneAsync("LobbyManager", LoadSceneMode.Additive);

        m_curGameLoad = eLoadingState.None;
        m_curStage    = eStageState.Stage01;

        PlayerPrefs.SetInt("IsClear", 0);      // 0이면 실패, 1이면 클리어


        theSound = FindObjectOfType <SoundManager>();
    }