Exemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        Script_SceneManager t = (Script_SceneManager)target;

        if (GUILayout.Button("Restart Game"))
        {
            Script_SceneManager.RestartGame();
        }
    }
Exemplo n.º 2
0
 /// <summary>
 /// Singleton needs to be in Awake because there are multiple
 /// of this, don't want to have to set up by both Start and Game
 /// </summary>
 public void Awake()
 {
     if (SM == null)
     {
         DontDestroyOnLoad(this.gameObject);
         SM = this;
     }
     else if (this != SM)
     {
         Destroy(this.gameObject);
     }
 }
    private void ToGameTransition(Transform submenu)
    {
        // Fade In Black Bg, then Fade Out Submenu
        bgBlack.Close();
        bgBlack.FadeIn(toLoadingBgBlackFadeInTime, () => {
            submenu.GetComponent <Script_CanvasGroupController>().FadeOut(
                toLoadingSubmenuFadeOutTime,
                () => StartCoroutine(WaitToLoadScene())
                );
        });

        IEnumerator WaitToLoadScene()
        {
            yield return(new WaitForSeconds(waitBlackScreenBeforeLoadingScreenTime));

            Script_SceneManager.ToGameScene();
        }
    }