Exemplo n.º 1
0
        public void OnTriggerExit2D(Collider2D other)
        {
            IAbilitySource abilitySource = other.GetComponent <IAbilitySource>();

            if (abilitySource == null)
            {
                return;
            }

            _abilitySource?.UnHighlight();

            if (_abilitySource != abilitySource)
            {
                return;
            }
            _abilitySource = null;
        }
Exemplo n.º 2
0
        public void OnTriggerStay2D(Collider2D other)
        {
            if (_abilitySource != null)
            {
                return;
            }

            IAbilitySource abilitySource = other.GetComponent <IAbilitySource>();

            if (abilitySource == null)
            {
                return;
            }

            if (_abilitySource != null && _abilitySource != abilitySource)
            {
                _abilitySource.UnHighlight();
            }

            abilitySource.Highlight();
            _abilitySource = abilitySource;
        }