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); } } }
//public Text infoCoins; // private void Awake() { // PlayerPrefs.DeleteAll (); // } private void Start() { GameParams.AddCoins(coins); }