Example #1
0
    public void Call()
    {
        PlaytimeData.Reset();

        ScreenTransition screenTransition = ScreenTransition.instance;

        if (screenTransition)
        {
            screenTransition.Call(scenePath);
        }
        else
        {
            ScreenTransition.LoadScene(scenePath);
        }
    }
Example #2
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Alpha3))
     {
         string           sceneName        = "DevScene";
         ScreenTransition screenTransition = ScreenTransition.instance;
         if (screenTransition)
         {
             screenTransition.Call(sceneName);
         }
         else
         {
             ScreenTransition.LoadScene(sceneName);
         }
     }
 }
Example #3
0
    public void RestartScene()
    {
        PlaytimeData.numberOfDeaths++;
        PlayerHealth.ResetSavedHealth();

        ScreenTransition screenTransition = ScreenTransition.instance;
        string           sceneName        = SceneManager.GetActiveScene().path;

        if (screenTransition)
        {
            screenTransition.Call(sceneName);
        }
        else
        {
            ScreenTransition.LoadScene(sceneName);
        }
    }
Example #4
0
    public void CallNextStage()
    {
        UpdateData();

        ScreenTransition screenTransition = ScreenTransition.instance;
        string           scenePath        = SceneManager.GetActiveScene().path;
        int currentIndex = int.Parse(scenePath.Substring(scenePath.Length - 7, 1));

        scenePath = scenePath.Substring(0, scenePath.Length - 7) + (currentIndex + 1) + ".unity";

        if (screenTransition)
        {
            screenTransition.Call(scenePath);
        }
        else
        {
            ScreenTransition.LoadScene(scenePath);
        }
    }
Example #5
0
    private IEnumerator WinSequence()
    {
        yield return(new WaitForSeconds(.5f));

        WinScreen winScreen = WinScreen.instance;

        if (winScreen)
        {
            winScreen.Show();
        }
        yield return(new WaitForSeconds(2));

        ScreenTransition screenTransition = ScreenTransition.instance;
        string           scenePath        = scenePath = "Assets/Scenes/WorldsScene.unity";

        if (screenTransition)
        {
            screenTransition.Call(scenePath);
        }
        else
        {
            ScreenTransition.LoadScene(scenePath);
        }
    }