Exemple #1
0
    //function to call once customer finishes eating food
    public void CustomerFinishedFood()
    {
        //remove the food in front of the customer
        foreach (Transform child in dishSpawnPoint)
        {
            NetworkServer.Destroy(child.gameObject);
        }

        finishedEating = true;

        //disable eating animation
        //Debug.Log("Customer is done eating food");

        if (isServer)
        {
            //Instantiate dirty dish in front of customer
            //Debug.Log("Spawning dirty dishes");
            ServerSpawnDirtyDish();
        }

        //all customers leave if they have all finished eating
        if (tableSeatedAt.CheckIfAllFinishedEating())
        {
            tableSeatedAt.EmptyTable();
        }
    }