public void GivePoints() { playerShip.UpdateScore(10); playerShip.GiveHealth(); Destroy(gameObject); }
public void RockTakesDamage(int damage) { RockHealth = RockHealth - damage; if (RockHealth <= 0) { playerShip.UpdateScore(100); Destroy(gameObject); Instantiate(Particles, transform.position, Quaternion.identity); if (Random.Range(0f, 20f) <= 5) { Instantiate(Points, transform.position, Quaternion.identity); } } }