예제 #1
0
    void Update()
    {
        if (targeting.FindTarget(range) != null)
        {   //add a non-null Tower-GameObject to the List
            AddTarget(targeting.FindTarget(range));
        }

        health = GetComponent <Health>().health;

        // return to overlord if health is 3 or lower
        if (health <= 3)
        {
            reportIntel = true;
        }

        // runs test script
        if (printList == true)
        {
            PrintListDebug();
        }
    }
예제 #2
0
 private bool ReturnifDead()
 {
     if (TargetUnit.gameObject == null)
     {
         attackManager.Target = null;
         UnitInfo newTarget = Targeting.FindTarget();
         if (newTarget != null)
         {
             commandManager.commandQueue.Insert(1, New(transform.gameObject, newTarget.gameObject, leashDistance, startingPoint));
         }
         else if (leashDistance < 10000)
         {
             commandManager.commandQueue.Insert(1, Cmd_Move.New(transform.gameObject, startingPoint));
         }
         commandManager.NextCommand();
         return(true);
     }
     return(false);
 }