public virtual bool CanGoPlayerSlot() { var PlayerSlots = FindObjectOfType<PlayerSlots>(); if (PlayerSlots.CanHoldItem(orderID)) { BasicGameEvents.RaiseOnProductAddedToSlot(orderID); return true; } else return false; }
void AddToPlayerSpot() { var PlayerSlots = FindObjectOfType <PlayerSlots>(); var product = GetComponent <DrinkableProduct>(); if (product != null && PlayerSlots != null) { if (PlayerSlots.CanHoldItem(product.orderID)) { BasicGameEvents.RaiseOnProductAddedToSlot(product.orderID); StartCoroutine(product.AnimateGoingToSlot()); } } else { Destroy(gameObject); } }
private void OnMouseDown() { if (!doorIsOpen && !isEmpty) { var PlayerSlots = FindObjectOfType <PlayerSlots>(); if (PlayerSlots.CanHoldItem(currentProduct.orderID)) { BasicGameEvents.RaiseOnProductAddedToSlot(currentProduct.orderID); StartCoroutine(currentProduct.AnimateGoingToSlot()); currentProduct = null; StartCoroutine(PlayDoorAnim(true, true)); } else { return; } } else if (isEmpty) { StartCoroutine(PlayDoorAnim(true, true)); } }