public ClosestInteractionZone ( |
||
position | A world position to test for proximity to this shelves interaction zones. | |
Результат |
public AddToCart(Customer customer, string desiredProduct, Shelf shelf) : base(customer) { this.desiredProduct = desiredProduct; this.shelf = shelf; interactionZone = shelf.ClosestInteractionZone(customer.Position); Vector3 destination = interactionZone.transform.position; moveControl.SetDestination(destination); // Think about the desired product GameObject product = supermarket.Catalogue[desiredProduct].Model; customer.Think(product); }
void NextEmptyShelf() { shelfToStock = supermarket.NextEmptyShelf(); if (shelfToStock != null) { //go stock the shelf interactionZone = shelfToStock.ClosestInteractionZone(staff.Position); Vector3 destination = interactionZone.transform.position; moveControl.SetDestination(destination); } else { staff.SetState(new Wander(staff)); } }