Пример #1
0
        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();
            }
        }
Пример #2
0
        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);
            }
        }