예제 #1
0
 public static void Flee(Unit unit) {
     GameObject closestEnemy = UnitQueries.ClosestEnemyInRange(unit);
     if (closestEnemy == null || closestEnemy.GetComponent<Unit>() == null) return;
     SetFleeingTarget(unit, closestEnemy.GetComponent<Unit>());
 }
예제 #2
0
 public static void TargetEnemy(Unit unit) {
     GameObject closestEnemy = UnitQueries.ClosestEnemyInRange(unit);
     if (closestEnemy == null || closestEnemy.GetComponent<Unit>() == null) return;
     unit.GetComponent<Target>().Change(closestEnemy, closestEnemy.GetComponent<Unit>().interactionRadius);
 }