Beispiel #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>());
 }
Beispiel #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);
 }