Example #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (!gm.car.GetComponent <Car>().IsCrash())
     {
         if (other.CompareTag("SensorCoins"))
         {
             move = true;
             GameParams.AddCoins(1);
             am.PlayCoin();
         }
         else if (other.CompareTag("Player"))
         {
             Destroy(gameObject);
         }
     }
 }
Example #2
0
    //public Text infoCoins;

    //	private void Awake() {
    //		PlayerPrefs.DeleteAll ();
    //	}

    private void Start()
    {
        GameParams.AddCoins(coins);
    }