public void SetContext(CustomerStateContext context) { _stateContext = context; _stateContext.StateMachine = this; _enterShopState.SetContext(_stateContext); _interactState.SetContext(_stateContext); _goToInteractState.SetContext(_stateContext); _exitShopState.SetContext(_stateContext); ChangeState(_enterShopState); }
private void SpawnNewCustomerAndSetIfForInteraction() { var nonBusyInteractionPoint = _interactablesHolder.GetNonBusyInteractableObject(); if (nonBusyInteractionPoint is null) { return; } nonBusyInteractionPoint.IsBusy = true; var newCustomer = _factory.SpawnNewCustomer(_customerSpawnPoint.position); CustomerStateContext stateContext = new CustomerStateContext(); stateContext.CustomerInteractPoint = nonBusyInteractionPoint; stateContext.EventsRelay = _eventsReley; stateContext.ShopEnterPoint = _shopEnter.position; stateContext.ShopExitPoint = _shopExit.position; newCustomer.SetContext(stateContext); }
public void SetContext(CustomerStateContext context) { context.CurrentCustomer = this; _stateMachine.SetContext(context); }
public void SetContext(CustomerStateContext context) { _stateContext = context; }