Example #1
0
    public void ApplyDamage(float damage)
    {
        currentHealth -= damage;

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