Beispiel #1
0
    public void barberWorking()
    {
        GameObject customerToCutHair;

        while (customerToCutHair = getNextCustomer())
        {
            cutHair(customerToCutHair);
        }
        Debug.Log("There is no more customers");
        barberScript.sleep();
    }
Beispiel #2
0
    public void barberLoop()       //or FixedUpdate?
    {
        Debug.Log("barber's loop");
        GameObject customerToCutHair;

        if (customerToCutHair = barbershopScript.getNextCustomer())          // return null only if there isnt any more customers
        {
            //Debug.Log("Barber aquired a costumer");
            if (!barberChairScript.isOccupied())
            {
                barbershopScript.aquireCustomer(customerToCutHair);
            }
        }

        if (!customerToCutHair)
        {
            Debug.Log("There is no more customers");
            barberScript.sleep();
        }
    }