private void Awake( ) { if (!_EVENT) //sets up the singleton. { _EVENT = this; } }
private void Start( ) { rb = rb ?? GetComponent <Rigidbody>(); rb.AddTorque(Random.insideUnitSphere, ForceMode.VelocityChange); rb.AddForce(Random.insideUnitSphere, ForceMode.Impulse); health = 10 * Size; EventHandeler.TriggerAsteroidSpawn(this); }
public void AddDamage(int points) { health -= points; EventHandeler.TriggerAsteroidDamage(this); }