예제 #1
0
        public override void DecideWhatToDo()
        {
            bool didRetargetUnit = false;

            if (PreferAttackingUnits)
            {
                didRetargetUnit = FindTargetToAttackHighLevelGoal.TryAssignAttackUnit(
                    replace: false,
                    owner: Owner,
                    allUnits: AllUnits,
                    aggroRadius: 80);
            }
            if (!didRetargetUnit)
            {
                if (IsInRangeToAttack() == false)
                {
                    PathfindToTarget();
                }
                else
                {
                    Owner.TryAttack(TargetBuilding);
                }
            }
        }
예제 #2
0
 private void CreateFindTargetGoal()
 {
     findTargetGoal       = new AI.FindTargetToAttackHighLevelGoal();
     findTargetGoal.Owner = this.Owner;
 }