Exemple #1
0
    public IEnumerator ResetGame()
    {
        finishFinished = false;

        TouchControls.LockControls();

        StartCoroutine(Fade(fadeImage, 1f, 1));

        yield return(new WaitForSeconds(1));

        letterbox.Deactivate();

        yield return(new WaitForSeconds(1));

        gameFinished = false;
        TouchControls.controlsLocked = false;

        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }
Exemple #2
0
    public IEnumerator FinishGame()
    {
        gameFinished = true;

        TouchControls.LockControls();

        warrior.Agent.destination = new Vector3(-15, -1.5f, 170);

        //Small velocity boost to trigger the walking animation
        warrior.Agent.velocity = new Vector3(0f, 0f, 0.01f);

        yield return(new WaitForSeconds(2));

        StartCoroutine(Fade(fadeImage, 0.75f, 2));

        yield return(new WaitForSeconds(2));

        skullManager.RectTransform.anchoredPosition = new Vector2((Screen.width / 2), Screen.height / 2);

        finishFinished = true;
    }