Ejemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     CookingState        = CookingPotState.isPotEmpty;
     InventoryInfoScript = GameObject.Find("InventoryInfo").GetComponent("InventoryInfo") as InventoryInfo;
     CookItemZoneLeft    = CookItemType.nothing;
     CookItemZoneRight   = CookItemType.nothing;
     PotFood             = Food.Nothing;
 }
Ejemplo n.º 2
0
    public void CookButton()
    {
        //둘중에 하나가 비어 있는 경우에는 요리가 되지 않게 해야함.
        if (CookItemZoneLeft == CookItemType.nothing || CookItemZoneRight == CookItemType.nothing)
        {
            return;
        }

        //재료가 부족하면 요리가 되지 않게 해야함.
        //좌=우 일때 재료 2소모 체크
        CheckFoodQuantity();

        //재료 소모
        UseFoodQuantity();

        if (PlayerEnergy.energy - 0.4f > 0)
        {
            PlayerEnergy.energy -= 0.4f;
        }

        //조합에 따라 요리가 다르게
        if ((CookItemZoneLeft == CookItemType.yogg && CookItemZoneRight == CookItemType.dragon) ||
            (CookItemZoneLeft == CookItemType.dragon && CookItemZoneRight == CookItemType.yogg))
        {
            PotFood = Food.Stick;
        }
        else if ((CookItemZoneLeft == CookItemType.berry && CookItemZoneRight == CookItemType.bread) ||
                 (CookItemZoneLeft == CookItemType.bread && CookItemZoneRight == CookItemType.berry))
        {
            PotFood = Food.BerrySandwich;
        }
        else if ((CookItemZoneLeft == CookItemType.dragon && CookItemZoneRight == CookItemType.banana) ||
                 (CookItemZoneLeft == CookItemType.banana && CookItemZoneRight == CookItemType.dragon))
        {
            PotFood = Food.WingSalad;
        }
        else if ((CookItemZoneLeft == CookItemType.turkey && CookItemZoneRight == CookItemType.bread) ||
                 (CookItemZoneLeft == CookItemType.bread && CookItemZoneRight == CookItemType.turkey))
        {
            PotFood = Food.RoastedTurkey;
        }
        else if ((CookItemZoneLeft == CookItemType.berry && CookItemZoneRight == CookItemType.mushroom) ||
                 (CookItemZoneLeft == CookItemType.mushroom && CookItemZoneRight == CookItemType.berry))
        {
            PotFood = Food.WitchSoup;
        }
        else
        {
            PotFood = Food.Spoiled;
        }

        CookExitButton();
        CookingState = CookingPotState.isCooking;
        GlobalVariable.cookSliderBool = true;
    }