Beispiel #1
0
    /// <summary>
    /// 设置数据
    /// </summary>
    /// <param name="foodData"></param>
    public void SetData(MenuInfoBean foodData, int foodLevel)
    {
        if (foodData != null)
        {
            //设置图标
            srFood.sprite = InnFoodHandler.Instance.manager.GetFoodSpriteByName(foodData.icon_key);
            //设置动画
            if (!CheckUtil.StringIsNull(foodData.anim_key))
            {
                AnimationClip animationClip = InnFoodHandler.Instance.manager.GetFoodAnimByName(foodData.anim_key);
                if (animationClip != null)
                {
                    animForFood.enabled    = true;
                    aocForFood["Original"] = animationClip;
                }
                else
                {
                    animForFood.enabled = false;
                }
            }
            else
            {
                animForFood.enabled = false;
            }
        }

        objGoodFood.SetActive(false);
        objPrefectFood.SetActive(false);
        if (foodData != null)
        {
            RarityEnum rarity = foodData.GetRarity();
            switch (rarity)
            {
            case RarityEnum.SuperRare:
                objPrefectFood.SetActive(true);
                break;

            case RarityEnum.SuperiorSuperRare:
                objGoodFood.SetActive(true);
                objPrefectFood.SetActive(true);
                break;
            }
        }
        //switch (foodLevel)
        //{
        //    case -1:
        //        objBadFood.SetActive(true);
        //        break;
        //    case 0:
        //        break;
        //    case 1:
        //        objGoodFood.SetActive(true);
        //        break;
        //    case 2:
        //        objPrefectFood.SetActive(true);
        //        break;
        //}
    }
 public void SetRate()
 {
     if (menuOwn == null)
     {
         tvRate.gameObject.SetActive(false);
         tvRate.text = "";
     }
     else
     {
         tvRate.gameObject.SetActive(true);
         RarityEnumTools.GetRarityDetails(menuInfo.GetRarity(), out string rarityName, out Color rarityColor);
         tvRate.text  = rarityName;
         tvRate.color = rarityColor;
     }
 }
Beispiel #3
0
    /// <summary>
    /// 设置数据
    /// </summary>
    /// <param name="menuOwn"></param>
    /// <param name="data"></param>
    public void SetData(MenuOwnBean menuOwn, MenuInfoBean data)
    {
        foodData    = data;
        menuOwnData = menuOwn;
        //设置详细信息弹窗
        if (pbFood != null)
        {
            pbFood.SetData(menuOwnData, foodData);
        }

        SetLevel(menuOwn.GetMenuLevel(), menuOwn.GetMenuLevelIcon());
        SetFoodIcon(foodData.icon_key);
        SetName(data.name);
        SetSellStatus(menuOwnData);
        menuOwn.GetPrice(data, out long priceL, out long priceM, out long priceS);
        SetPrice(priceL, priceM, priceS);
        SetResearch(menuOwn.GetMenuStatus());
        SetResearchPopup(menuOwn, data);
        SetMenuClass(data.GetRarity());
    }