Example #1
0
 public void SetData(EIngredientType type, int id, string name, int price)
 {
     this.type  = type;
     this.id    = id;
     this.name  = name;
     this.price = price;
 }
Example #2
0
    /// <summary>
    /// 음식 만들 재료 세팅 함수
    /// </summary>
    /// <param name="_id"></param>
    /// <param name="_type">고기 : 0번 소스 : 1번 가루 : 2번</param>
    private void OnSetFoodMakeItem(int _id, EIngredientType _type)
    {
        InGameCookingController cookingController = FindObjectOfType <InGameCookingController>();

        if (cookingController)
        {
            cookingController.UseIngredient(_type, _id);
        }
#if DEBUG_LOG
        Debug.Log("ITEM ID : " + _id + " TYPE : " + _type);
#endif
    }
Example #3
0
    public XMLIngredient GetIngredient(EIngredientType type, int id)
    {
        if (ingredients == null)
        {
            //Initialize();
        }

        List <XMLIngredient> .Enumerator eIngredient = ingredients.GetEnumerator();

        while (eIngredient.MoveNext())
        {
            XMLIngredient ingredient = eIngredient.Current;

            if (ingredient.type.Equals(type) && ingredient.id.Equals(id))
            {
                return(ingredient);
            }
        }

        throw new Exception("Invalid Galbi as ID");
    }
Example #4
0
 public string GetResourcePath(EIngredientType type)
 {
     return(string.Format("{0}/{1}", (type == EIngredientType.Deco) ? ResourcePath.decoObject : ResourcePath.cookObject, name));
 }
Example #5
0
 public List <XMLIngredient> GetIngredients(EIngredientType _type)
 {
     return(ingredients.FindAll(i => i.type == _type));
 }
Example #6
0
 public void SetIngredient(EIngredientType type, int id, string name, int price)
 {
     Type = type;
     SetItem(id, name, price);
 }
Example #7
0
 public void SetIngredient(EIngredientType type, IIngredient ingredient)
 {
     Type = type;
     SetItem(ingredient.itemID, ingredient.itemName, ingredient.itemPrice);
 }
    /* DESC :>
     * 갈비, 소스, 파우더 사용
     * 갈비가 존재하지 않고, 냥이가 있을때 갈비 올림
     * 갈비가 존재하고, 소스 및 파우더가 사용되지 않았을 때 소스 및 파우더 사용
     */
    public void UseIngredient(EIngredientType type, int id)
    {
        if (GlobalData.getInstance.GetIngredientAmount(type, id) <= 0)
        {
            PopupManager.getInstance.Show(storePopup);
        }

        switch (cookState)
        {
        case ECookingState.SHOW_RECIPE:
        {
            if (type == EIngredientType.Galbi)
            {
                SetGalbi(id);

                cookState = ECookingState.SWIPING;

                GlobalData.getInstance.GetIngredient(type, id).amount--;
                GlobalData.getInstance.SetIngredient(type, id);

                // DESC :> Powder 갈비에 따른 준비 컬러값 및 좌표
                goParents.sauce.transform.localPosition  = saucePos[id - 1];
                goParents.powder.transform.localPosition = powderPos[id - 1];
                images.powder.color = powderReadyColors[id - 1];
            }

            break;
        }

        case ECookingState.SWIPING_END:
        {
            if (type == EIngredientType.Sauce)
            {
                if (ingredients.sauce.itemID < 1)
                {
                    SpreadIngredient(ingredients.sauce, id);
                    images.sauce.color = sauceColors[id - 1];
                }
            }
            if (type == EIngredientType.Powder)
            {
                if (ingredients.powder.itemID < 1)
                {
                    goParents.powder.SetActive(true);
                    SpreadIngredient(ingredients.powder, id);
                    images.powder.color = powderColors[id - 1];
                }
            }
            if (ingredients.recipe.Equals(ingredients.galbi, ingredients.sauce, ingredients.powder))
            {
                ingredients.galbi.CookComplete();
                cookState = ECookingState.COMPLETE;
            }

            break;
        }

        default:
            break;
        }
    }
Example #9
0
 public TutorialNeededIngredient(EIngredientType _type, int _id, int _amount)
 {
     type   = _type;
     id     = _id;
     amount = _amount;
 }