public bool DropStack() { action = DriverAction.goingToGetStack; currentStack.handTruck = null; currentStack.SetParent(null); currentStack.SortStack(currentStack.boxStackPosition, true, true); currentStack.droppedOff = true; dm.dispensary.inventory.AddLooseBoxStack(currentStack); /*foreach (Box box in currentStack.boxList) * { * StorageBox storageBox = (StorageBox)box.product; * dm.dispensary.inventory.AddLooseBox(storageBox); * }*/ dm.dispensary.inventory.RefreshInventoryList(false); handTruck.Tip(true); NextAction(); return(true); }
public bool PickupStack() { action = DriverAction.droppingOffStack; if (handTruck == null) { GameObject handTruckGO = Instantiate(db.GetStoreObject("Hand Truck").gameObject_); handTruck = handTruckGO.GetComponent <Handtruck>(); handTruck.driver = this; handTruckGO.transform.position = handTruckPosition.transform.position; } BoxStack newStack = truck.UnloadStack(); currentStack = newStack; newStack.handTruck = handTruck; newStack.SetParent(handTruck.gameObject.transform); handTruck.LoadBoxes(newStack); handTruck.transform.parent = transform; handTruck.Tip(true); NextAction(); return(true); }