コード例 #1
0
    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);
        }
    }
コード例 #2
0
    private void ServeToCustomer()
    {
        if (mServingBowl == null)
        {
            return;
        }

        Customer customer = mCurrentCollider.GetComponent <Customer>();

        if (customer != null)
        {
            customer.ServeSalad(mServingBowl);

            Destroy(mServingBowl.gameObject);
            mServingBowl = null;
        }
    }
コード例 #3
0
ファイル: Customer.cs プロジェクト: supratimr/Salad-Chef
    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);
    }