public void initBuildingLinkCard(string id)
    {
        BuildingId = id;
        BasicSubMenuPanel P = null;

        for (int i = 0; i < MCP.homeScene.AllSubMenus.Length; i++)
        {
            if (MCP.homeScene.AllSubMenus[i] == null)
            {
                continue;
            }
            P = MCP.homeScene.AllSubMenus[i].GetComponent <BasicSubMenuPanel>();
            if (P.buildingId == BuildingId)
            {
                IndexInHS = i;
                thisTag   = (HomeScene.HomeSceneSubMenu)i;
                //buildingImg
                //NPCImg
                NameText.text = thisTag.ToString() + "·" + SDGameManager.T("Lv.")
                                + P.Level;
                break;
            }
        }
        if (P == null)
        {
            return;
        }
        bool flag = P.CheckIfCanLvUp();

        lvUpBtn.interactable = flag;
    }
Exemple #2
0
    public void lvUpBtnTapped()
    {
        BasicSubMenuPanel P = AllSubMenus[(int)CurrentSubMenuType].GetComponent <BasicSubMenuPanel>();

        if (P.CheckIfCanLvUp())
        {
            P.BtnToLvUp();
        }
    }
    public void ExtraBtnTapped()
    {
        BasicSubMenuPanel P = MCP.homeScene.AllSubMenus[(int)thisTag]
                              .GetComponent <BasicSubMenuPanel>();
        bool flag = P.CheckIfCanLvUp();

        if (flag)
        {
            P.BtnToLvUp();
        }
    }
Exemple #4
0
    public void checkLvUpBtn()
    {
        BasicSubMenuPanel P = AllSubMenus[(int)CurrentSubMenuType].GetComponent <BasicSubMenuPanel>();

        if (P.CheckIfCanLvUp())
        {
            int lv = P.Level;
            SubMenuLvUpBtn.GetComponentInChildren <Text>().text
                = "升级 </n> 当前等级" + lv;
            SubMenuLvUpBtn.gameObject.SetActive(true);
        }
        else
        {
            SubMenuLvUpBtn.gameObject.SetActive(false);
        }
    }