예제 #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         playerScore.addCoin(CoinValue);
         playerScore.addScore(ScoreValue);
         transform.position -= new Vector3(0, CoinMagnetRadius + 1, 0);        //Hiding the coin away from view as if it was destroyed. We can't recycle it now because the TrackObstacle must do it when the Track is recycled.Increase the value if you can still see the coin.
         if (GroupCoin)
         {
             needtorest = true;
             ResetTimer = 0f;
         }
     }
 }
 void CoinMagnetActivate()
 {
     CoinMagnetParticle.SetActive(true);
     ps.addScore(CoinMagnetScore);
 }