private void Start() { sync = false; controller = GetComponent <PlayerController>(); stateCleanTable = AddState(new StateCleanTable()); stateSelectWasher = AddState(new StateSelectWasher()); stateThrowTrash = AddState(new StateThrowTrash()); goToTable = new StateGoTo <PlayerController>(controller, this, controller.actionDistance, stateCleanTable); stateMoveToTable = AddState(goToTable); goToWasher = new StateGoTo <PlayerController>(controller, this, controller.actionDistance, stateThrowTrash); stateMoveToWasher = AddState(goToWasher); goToTable.SetDestination(table.transform.position); SwitchState(stateMoveToTable); }
private void Start() { controller = GetComponent <PlayerController>(); controller.SetDestination(foodDesk.transform.position); stateGettingFood = AddState(new StateGettingFood()); stateSelectCustomer = AddState(new StateSelectCustomer()); stateDeliverFood = AddState(new StateDeliverFood()); goToFood = new StateGoTo <PlayerController>(controller, this, controller.actionDistance, stateGettingFood); stateWalkToFood = AddState(goToFood); goToFood.SetDestination(foodDesk.transform.position); goToCustomer = new StateGoTo <PlayerController>(controller, this, controller.actionDistance, stateDeliverFood); stateWalkToCustomer = AddState(goToCustomer); SwitchState(stateWalkToFood); }
private void Start() { queue = FindObjectOfType <CustomerQueue>(); group = GetComponent <CustomerGroup>(); employee = GameManager.instance.localPlayer.Employee(); stateWaitForTable = AddState(new StateWaitForTable()); stateSeatTable = AddState(new StateSeatTable()); StateGoTo <CustomerGroup> goToDoor = new StateGoTo <CustomerGroup>(group, this, 1f, stateWaitForTable); goToDoor.SetDestination(() => { return(queue.NextQueuePosition()); }); stateWalkToDoor = AddState(goToDoor); goToTable = new StateGoTo <CustomerGroup>(group, this, 1f, stateSeatTable); stateWalkToTable = AddState(goToTable); if (photonView.isMine) { SwitchState(stateWalkToDoor); } }
public void SetDestination(Vector3 destination) { move.SetDestination(destination); }