public void OnTriggerStay(Collider2D collider)
 {
     if (collider.gameObject == Owner.CurrentSleepPlace.gameObject)
     {
         StatesUtils.EnterBuilding(Owner, TIRED);
         Owner.StateMachineRef.ChangeState(Owner.States[Agent.StatesEnum.Sleeping]);
     }
 }
Ejemplo n.º 2
0
 public void OnTriggerStay(Collider2D collider)
 {
     if (collider.gameObject == Owner.CurrentWorkplace.gameObject && Owner.CurrentWorkplace.WorkersNeeded)
     {
         StatesUtils.EnterBuilding(Owner, WORK);
         Owner.StateMachineRef.ChangeState(Owner.States[Agent.StatesEnum.Working]);
     }
 }
Ejemplo n.º 3
0
 public void OnTriggerStay(Collider2D collider)
 {
     if (collider.gameObject == Owner.ChosenFoodPlace.gameObject)
     {
         if (Owner.ChosenFoodPlace.FeedingVacancy)
         {
             StatesUtils.EnterBuilding(Owner, HUNGRY);
             Owner.StateMachineRef.ChangeState(Owner.States[Agent.StatesEnum.Eating]);
         }
         else
         {
             Owner.StateMachineRef.ChangeState(Owner.States[Agent.StatesEnum.SearchingFood]);
         }
     }
 }