private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "Ice")
        {
            isSliding = true;
        }

        if (other.gameObject.tag == "Hole")
        {
            Debug.Log("GameOver");
            endGameManager.GameOver();
        }

        if (other.gameObject.tag == "Carpet")
        {
            other.gameObject.tag = "BlockedCarpet";
        }
    }
Beispiel #2
0
 private void UpdateFear(bool areScared)
 {
     if (areScared)
     {
         fearPoints += decreaseSpeed * Time.deltaTime;
         if (fearPoints >= maximumFearPoints)
         {
             Debug.Log("GameOver !");
             endGameManager.GameOver();
             fearPoints = maximumFearPoints;
         }
     }
     else
     {
         fearPoints -= regenSpeed * Time.deltaTime;
         if (fearPoints < 0)
         {
             fearPoints = 0;
         }
     }
 }