Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     playerLives = playerController.GetLives();
     if (playerLives == 0)
     {
         Time.timeScale = 0.2f;
         sceneSwitcher.LoadGameOver();
     }
 }
Exemple #2
0
    // Start is called before the first frame update
    void Start()
    {
        playerController = GameObject.FindGameObjectWithTag("Player").transform.GetComponent <PlayerPlatformerController>();
        playerLives      = playerController.GetLives();
        Debug.Log("Player lives: " + playerLives);
        sceneSwitcher = GameObject.Find("SceneSwitcher").transform.GetComponent <SceneSwitcher>();

        if (PlayerStats.Instance.bHasRicky)
        {
            Instantiate(dogButtonPrefab, GameObject.Find("Canvas").transform);
            Instantiate(rickyPrefab);
        }

        Time.timeScale = 1.0f;
    }