Пример #1
0
        private void CalculateNearestAllyTeamEntity()
        {
            _nearestAllyTeamEntity = EntitiesNeightboorManager.GetClosestAllyEntity(transform.position, Entity.Team);

            if (_nearestAllyTeamEntity != null && IsEntityInShiftRange(_nearestAllyTeamEntity))
            {
                OnAllyEnterShiftRange?.Invoke(_nearestAllyTeamEntity);
            }
        }
Пример #2
0
        void Awake()
        {
            _frameOffset = UnityEngine.Random.Range(0, frameIntervalToCheckNearestEntities);
            EntitiesNeightboorManager.Initialize();

            if (_layerMaskEntity == -1)
            {
                _layerMaskEntity = LayerMask.GetMask("Entity");
            }
        }
Пример #3
0
        private void CalculateNearestOpponentTeamEntity()
        {
            _nearestOpponentTeamEntity = EntitiesNeightboorManager.GetClosestOpponentEntity(transform.position, Entity.Team);

            if (_nearestOpponentTeamEntity != null)
            {
                if (IsEntityInAttackRange(_nearestOpponentTeamEntity))
                {
                    OnOpponentEnterAttackRange?.Invoke(_nearestOpponentTeamEntity);
                }

                if (IsEntityInViewRadius(_nearestOpponentTeamEntity))
                {
                    OnOpponentEnterViewRange?.Invoke(_nearestOpponentTeamEntity);
                }
            }
        }