Exemplo n.º 1
0
    IEnumerator ChopProcess(Vegetable v)
    {
        boardAssignedTo.PauseMovement();
        //Wait for a while to finish chopping
        yield return(new WaitForSeconds(1));

        v.ChopVegetable();

        //If vegetable slot if empty, then assign it to the vegetable slot of the cutting board
        if (veggie == null)
        {
            if (salad == null)
            {
                MakeSalad(v);
            }
            else
            {
                if (!salad.ContainsVegetable(v))
                {
                    AddToSalad(v);
                }
                else
                {
                    veggie = v;
                }
            }
        }
        else
        {
            Debug.Log("Veggie and salad are not null....Give salad to the customer or take it out");
        }

        boardAssignedTo.ResumeMovement();

        cuttingInProcess = false;
    }