コード例 #1
0
ファイル: UISceneManager.cs プロジェクト: GlintGame/Glint
    private IEnumerator LoadSceneCoroutine(string sceneName, BeforeUnloadDelegate beforeUnloadDelegate)
    {
        TransitionCanvas.getInstance().FadeOut(0.5f);
        yield return(StartCoroutine(utils.Coroutine.WaitForRealSeconds(0.5f)));

        beforeUnloadDelegate();
        PlayerScore.Reset();
        SceneManager.LoadScene(sceneName);
    }
コード例 #2
0
ファイル: TransitionCanvas.cs プロジェクト: GlintGame/Glint
    public static TransitionCanvas getInstance()
    {
        if (TransitionCanvas.instance == null)
        {
            GameObject FadeCanvasGO = (GameObject)MonoBehaviour.Instantiate(Resources.Load("UI/Fade Canvas"));
            TransitionCanvas.fadePanel = FadeCanvasGO.transform.GetChild(0).GetComponent <Image>();
            TransitionCanvas.instance  = FadeCanvasGO.GetComponent <TransitionCanvas>();
        }

        return(TransitionCanvas.instance);
    }
コード例 #3
0
 /// <summary>
 /// Ensures that this object is a singleton.
 /// </summary>
 /// <returns></returns>
 private bool CheckForSingleton()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this);
         return(false);
     }
     else
     {
         Destroy(this.gameObject);
         return(true);
     }
 }
コード例 #4
0
    public void PushPanel(TransitionCanvas newPanel)
    {
        if (panelStack.Count > 0 && panelStack.Peek() == newPanel)
        {
            PopCurrentMenu();
        }
        else
        {
            // slight kludge, since we never make them inactive
            newPanel.gameObject.SetActive(true);

            if (panelStack.Count > 0)
            {
                panelStack.Peek().TransitionOut();
            }

            newPanel.TransitionIn();
            panelStack.Push(newPanel);
        }
    }
コード例 #5
0
 public bool IsTop(TransitionCanvas canvas)
 {
     return(panelStack.Count > 0 && panelStack.Peek() == canvas);
 }
コード例 #6
0
ファイル: UISceneManager.cs プロジェクト: GlintGame/Glint
 void Awake()
 {
     TransitionCanvas.getInstance().FadeIn(0.5f);
 }
コード例 #7
0
 protected override void Awake()
 {
     base.Awake();
     Instance = this;
 }