예제 #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     scoreKeeper = GameObject.Find("Player").GetComponent <ScoreKeeper>();
     if (collision.gameObject.GetComponent <PlayerController>())
     {
         if (!addedCoin)
         {
             scoreKeeper.AddCoin();
             addedCoin = true;
         }
         animator.SetTrigger("Grab");
     }
 }