private void OnTriggerExit(Collider other) { FactionItem collidingItem = other.gameObject.GetComponent <FactionItem>(); //Enemy is going away if i am colliding with an item i am not an owner of if (collidingItem != null && collidingItem.Owner != _owner) { itemEventsManager.onEnemyAway.Invoke(); } }
private void OnTriggerEnter(Collider other) { FactionItem collidingItem = other.gameObject.GetComponent <FactionItem>(); //Enemy is approaching if i am colliding with an item i am not an owner of if (collidingItem != null && collidingItem.Owner != _owner) { itemEventsManager.onEnemyApproach.Invoke(other.gameObject); } }