void Attack() { if (attackStats != null) { attackStats.Damage(20); } }
void OnTriggerEnter(Collider other) { ObjectStats objectStats = other.GetComponent <ObjectStats>(); if (objectStats != null && objectStats.GoblinFaction != goblinFaction) { objectStats.Damage(damage); Destroy(gameObject); } }