Beispiel #1
0
    private IEnumerator RestartGameCo()
    {
        //Move it back
        if (thePlayer.rope)
        {
            GameObject.Destroy(thePlayer.rope);
        }

        //Stop everything
        thePlayer.CallOnDeath();
        scoreManagerRef.scoreIncreasing = false;
        musicSound.Stop();

        yield return(new WaitForSeconds(2f));


        platformList = FindObjectsOfType <PlatformDestroyer>();
        for (int i = 0; i < platformList.Length; i++)
        {
            platformList[i].gameObject.SetActive(false);
        }


        thePlayer.transform.position = playerStartPoint;
        platformGenerator.position   = platformStartPoint;

        //Restart stuff
        scoreManagerRef.scoreCount = 0;
        thePlayer.gameObject.SetActive(true);
        overlayRef.SetActive(true);
        subHeadingRef.GetComponent <RandomSubHeading>().GenerateRandomSubHeading();

        //Stop Power ups
        powerManagerRef.GetComponent <PowerUpManager>().DisablePowerUp();

        //ChaseBox Reset
        scoreManagerRef.GetComponent <ScoreManager>().pursuitText.color = Color.white;
        scoreManagerRef.GetComponent <ScoreManager>().pursuitText.text  = "Lava distance \n- 30 M";
        chaserKillbox.GetComponent <ChaseBoxScript>().shouldMove        = false;
        chaserKillbox.GetComponent <ChaseBoxScript>().RestartChaserPosition();
    }