Ejemplo n.º 1
0
 public int ScoreAmount = 1;             //Score
 void OnTriggerEnter2D(Collider2D other) //To know when the ball reaches the circles
 {
     if (other.gameObject.tag == "Player")
     {
         ManagerReferences refs = GameObject.Find("Manager").GetComponent <ManagerReferences>();
         refs.IncreaseScore(ScoreAmount);
         this.gameObject.SetActive(false); //Make coin Hidden
         Destroy(this);                    //Make coin Destroy the script
     }
 }