Ejemplo n.º 1
0
    void ChangeCostIcon()
    {
        Transform iconTransform = _item_List_Father.GetChild(5).GetChild(0);
        Transform goldIcon      = iconTransform.GetChild(0);
        Transform diamondIcon   = iconTransform.GetChild(1);

        if (!iconTransform.name.Contains("icon"))
        {
            Debug.LogError("升级按钮上的图标获取错误");
        }

        if (!MyKeys.JudgeLevelMax())
        {
            int hero_Level = MyKeys.GetHeroLevel(MyKeys.CurrentSelectedHero);

            if (hero_Level < MyKeys.Level_Cost_Change_Point)
            {
                goldIcon.gameObject.SetActive(true);
                diamondIcon.gameObject.SetActive(false);
            }
            else
            {
                goldIcon.gameObject.SetActive(false);
                diamondIcon.gameObject.SetActive(true);
            }
        }
        else
        {
            goldIcon.gameObject.SetActive(false);
            diamondIcon.gameObject.SetActive(false);
        }
    }
Ejemplo n.º 2
0
 void JudgeMaxButtonState()
 {
     //判断当前英雄是否是最高级
     if (MyKeys.JudgeLevelMax())
     {
         SetButtonInactivity(_level_Up_Button);
         SetButtonInactivity(_level_Up_Max_Button);
     }
     else
     {
         SetButtonActivity(_level_Up_Button);
         SetButtonActivity(_level_Up_Max_Button);
     }
 }
Ejemplo n.º 3
0
    //判断显示
    void JudgeActive()
    {
        if (!MyKeys.JudgeLevelMax())
        {
            int hero_Level = MyKeys.GetHeroLevel(MyKeys.CurrentSelectedHero);
            int pay_Gold   = (hero_Level + 1) * 100;

            if (MyKeys.Gold_Value > pay_Gold)
            {
                gameObject.SetActive(true);
            }
            else
            {
                gameObject.SetActive(false);
            }
        }
        else
        {
            gameObject.SetActive(false);
        }
    }
Ejemplo n.º 4
0
    void ChangeCostTest()
    {
        if (!MyKeys.JudgeLevelMax())
        {
            int hero_Level = MyKeys.GetHeroLevel(MyKeys.CurrentSelectedHero);
            if (hero_Level < MyKeys.Level_Cost_Change_Point)
            {
                int temp = (hero_Level + 1) * 100;
                _Cost_Text.text = temp.ToString();

                if (MyKeys.Gold_Value < temp)
                {
                    SetButtonInactivity(_level_Up_Button);
                }
                else
                {
                    SetButtonActivity(_level_Up_Button);
                }
            }
            else
            {
                _Cost_Text.text = MyKeys.Level_Cost_Diamond.ToString();
                if (MyKeys.Diamond_Value < MyKeys.Level_Cost_Diamond)
                {
                    SetButtonInactivity(_level_Up_Button);
                }
                else
                {
                    SetButtonActivity(_level_Up_Button);
                }
            }
        }
        else
        {
            _Cost_Text.text = "满级";
            SetButtonInactivity(_level_Up_Button);
            _red_Point.SetActive(false);
        }
    }