public void ApplyDamage(float damage) { currentHealth -= damage; if (currentHealth <= 0) { FXGenerator.GroundExplosion(transform.position); Destroy(gameObject); } }
private void OnTriggerEnter2D(Collider2D collision) { FXGenerator.Hit(transform.position); collision.GetComponentInParent <RunningCharacter>().ApplyDamage(1.0f); Destroy(gameObject); }
// Use this for initialization void Start() { instance = this; }