public void OnTriggerStay(Collider2D collider) { if (collider.gameObject == Owner.CurrentSleepPlace.gameObject) { StatesUtils.EnterBuilding(Owner, TIRED); Owner.StateMachineRef.ChangeState(Owner.States[Agent.StatesEnum.Sleeping]); } }
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]); } }
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]); } } }