/// <summary> /// Moves the plate off the screen and serves the burger /// </summary> IEnumerator ServeToCustomer_() { _action = ChefAction.Serving; var rightPosition = Chef.PlatePosition() + 12f; // move plate right while (Chef.Plate.localPosition.x < rightPosition) { Chef.Plate.Translate(new Vector3(0.25f, 0, 0)); yield return(new WaitForSeconds(0.01f)); } // give the burger to the customer _customerHandler.CustomerServed(_burgerSelections); // update UI with next 10 orders Chef.DisplayOrders(_customerHandler.GetNextOrders(10)); // remove unused items ClearPlate_(); yield return(new WaitForSeconds(0.25f)); // move plate left while (Chef.Plate.localPosition.x > Chef.PlatePosition()) { Chef.Plate.Translate(new Vector3(-0.25f, 0, 0)); yield return(new WaitForSeconds(0.01f)); } Chef.Plate.localPosition = new Vector3(Chef.PlatePosition(), Chef.Plate.localPosition.y, Chef.Plate.localPosition.z); // next action _action = ChefAction.FacingBoard; }