private void OnPickupDone(List <IngredientData> data) { GameObject bowlObj = Instantiate <GameObject>(mServingBowlObject, transform); bowlObj.transform.localPosition = Vector3.up * mPickupPositionMultiplier; mServingBowl = bowlObj.GetComponent <ServingBowl>(); if (mServingBowl != null) { mServingBowl.AddSalad(data); } }
private void ServeToCustomer() { if (mServingBowl == null) { return; } Customer customer = mCurrentCollider.GetComponent <Customer>(); if (customer != null) { customer.ServeSalad(mServingBowl); Destroy(mServingBowl.gameObject); mServingBowl = null; } }
public void ServeSalad(ServingBowl bowl) { if (mCurrentSalad.IngredientList.Count != bowl.IngredientList.Count) { OnValidateSalad(false); return; } for (int i = 0; i < bowl.IngredientList.Count; i++) { if (!mCurrentSalad.IngredientList.Contains(bowl.IngredientList[i].Type)) { OnValidateSalad(false); return; } } OnValidateSalad(true); }