Exemple #1
0
 override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     base.OnStateExit(animator, stateInfo, layerIndex);
     MovementController[] thisUnit = BigBookBasic.ThisUnitToArray(movement);
     unit.player.playerController.MoveToObject(aIController.returnTarget.gameObject, thisUnit);
     TimeTickSystem.OnTick -= TimeTickSystem_OnTick;
 }
 public void FindStorage()
 {
     //een storage zoeken om de resources heen te sturen. kunnen álle storages van deze player zijn.
     ac.returnTarget = ac.actualTarget;
     ac.actualTarget = sense.FindStorage(hasResourceType);
     if (ac.actualTarget != null)
     {
         MovementController movement = unit.GetComponent <MovementController>();
         if (movement != null)
         {
             MovementController[] unitArray = BigBookBasic.ThisUnitToArray(movement);
             unit.player.playerController.MoveToObject(ac.actualTarget.gameObject, unitArray);
         }
     }
 }
 public void FindNewResource()
 {
     //als een resource leeg is en character heeft geen resources, dan zoeken naar een nieuwe. moet binnen viewRange.
     ac.returnTarget = null;
     ac.actualTarget = sense.FindNewResource(hasResourceType);
     if (ac.actualTarget != null)
     {
         MovementController movement = unit.GetComponent <MovementController>();
         if (movement != null)
         {
             MovementController[] unitArray = BigBookBasic.ThisUnitToArray(movement);
             unit.player.playerController.MoveToObject(ac.actualTarget.gameObject, unitArray);
             return;
         }
     }
     ac.animator.SetBool("HasResources", false);
     ac.animator.SetBool("IsGathering", false);
 }