Exemple #1
0
        /// <summary>
        /// 重置环境
        /// </summary>
        IEnumerator doReset()
        {
            svrManager.SetOverlayFade(SvrManager.eFadeState.FadeOut);
            yield return(new WaitUntil(() => svrManager.IsOverlayFading() == false));

            svrManager.Shutdown();
            yield return(new WaitUntil(() => svrManager.Initialized == false));

            SceneManager.LoadScene(sceneIndex);
            System.GC.Collect();
        }
Exemple #2
0
    public IEnumerator HandleQuit()
    {
        svrManager.SetOverlayFade(SvrManager.eFadeState.FadeOut);
        yield return(new WaitUntil(() => svrManager.IsOverlayFading() == false));

        Application.Quit();

        HandleBack = null;
    }
Exemple #3
0
    IEnumerator HandleBackButton()
    {
        svrManager.SetOverlayFade(SvrManager.eFadeState.FadeOut);
        yield return(new WaitUntil(() => svrManager.IsOverlayFading() == false));

        // Load next scene in build settings, quit when done
        if (++sceneIndex < SceneManager.sceneCountInBuildSettings)
        {
            svrManager.Shutdown();
            yield return(new WaitUntil(() => svrManager.Initialized == false));

            SceneManager.LoadScene(sceneIndex);

            System.GC.Collect();
        }
        else
        {
            sceneIndex = -1;
            Application.Quit();
        }
    }
Exemple #4
0
    private IEnumerator DisplayEvents()
    {
        while (true)
        {
            yield return(new WaitForSecondsRealtime(2.0f));

            if (!svrManager.IsOverlayFading())
            {
                if (events.Count > 0)
                {
                    var eventType = events[0];
                    _eventText.gameObject.SetActive(true);
                    _eventText.text = eventType.ToString();
                    events.RemoveAt(0);
                }
                else if (_eventText.gameObject.activeSelf)
                {
                    _eventText.gameObject.SetActive(false);
                }
            }
        }
    }