Example #1
0
 void Attack()
 {
     if (attackStats != null)
     {
         attackStats.Damage(20);
     }
 }
Example #2
0
    void OnTriggerEnter(Collider other)
    {
        ObjectStats objectStats = other.GetComponent <ObjectStats>();

        if (objectStats != null && objectStats.GoblinFaction != goblinFaction)
        {
            objectStats.Damage(damage);
            Destroy(gameObject);
        }
    }