Exemple #1
0
    // OK!! Let's take some food
    // First take a dish
    IEnumerator LetsTakeFood()
    {
        state = GuestState.TakeDish;
        Say("Take Dish!");
        yield return(new WaitForSeconds(.5f));

        // Let's take Dish
        var tDishTable = DishTable.allDishTables[0];

        // If Don't have more dishes??
        // This guy will be angry
        GoToSocketAndUse(TakeDishFormDishTable, tDishTable, tDishTable.socket);
        yield return(new WaitUntil(() => isReachToPoint));

        yield return(new WaitForSeconds(.5f));

        if (isAngry)
        {
            yield break;
        }
        // Taked dish

        if (dishes.Count == 0)
        {
            Say("접시 어디??");
            GoToSocketAndUse(ownChair);
            yield return(new WaitUntil(() => isReachToPoint));

            yield return(LetsTakeFood());
        }
        // Let's take Food
        state = GuestState.TakeFood;
        Say("음식가져와야지");
        var tFood = PerferFoodM.self.GetRandomFood();

        GoToSocketAndUse(TakeFood, tFood, tFood.socket);
        yield return(new WaitUntil(() => isReachToPoint));

        // Taked Food on dish

        // Get back to your own chair
        // He can Throw dish on Ground
        // ownChair can be null
        GoToSocketAndUse(ownChair);
        yield return(new WaitUntil(() => isReachToPoint));

        dishForEat         = ThrowAwayDish(ownChair.GetDishPoint());
        dishForEat.isClean = false;

        yield return(StartEat());
    }