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

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