コード例 #1
0
ファイル: ChopMaster.cs プロジェクト: RJuan95/Daddy-s
    // Update is called once per frame
    void Update()
    {
        if (gameLoop.delay >= 15)
        {
            if (activated)
            {
                GenerateArrowSequence();
                if (!gameLoop.GetRecipe().Contains(chosenIngredient.tag))
                {
                    gameLoop.incNumWrongIngredients();
                }
                //THIS IS FOR PUNISHING TOO MUCH OF ONE INGREDIENT
                //if (!conveyor.GetNeededIngredients().Contains(chosenIngredient.tag))
                //    gameLoop.incNumWrongIngredients();
            }
            else if (chosenIngredient != null)
            {
                if (handleInput())
                {
                    gameLoop.cutSuccessfully = true;
                    gameLoop.vegetableCut    = chosenIngredient.tag;
                    if (!gameLoop.GetRecipe().Contains(chosenIngredient.tag))
                    {
                        gameLoop.incWrongIngredientsChopped();
                    }
                    Reset();
                }
            }

            if (conveyor.movingVeggie)
            {
                handManager.GoToCutPos();
            }
        }
    }