示例#1
0
        void Start()
        {
            if (!UIMainControl.EnablePerkButton())
            {
                thisObj.SetActive(false);
            }

            if (!manuallySetupItem)
            {
                List <Perk> perkList = PerkManager.GetPerkList();
                for (int i = 0; i < perkList.Count; i++)
                {
                    if (i == 0)
                    {
                        perkItemList[0].Init();
                    }
                    else if (i > 0)
                    {
                        perkItemList.Add(UIPerkItem.Clone(perkItemList[0].rootObj, "PerkButton" + (i + 1)));
                    }

                    perkItemList[i].imgIcon.sprite = perkList[i].icon;
                    perkItemList[i].perkID         = perkList[i].prefabID;
                    perkItemList[i].selectHighlight.SetActive(i == 0);

                    perkItemList[i].SetCallback(null, null, this.OnPerkItem, null);
                }

                UpdateContentRectSize();
            }
            else
            {
                for (int i = 0; i < perkItemList.Count; i++)
                {
                    perkItemList[i].Init();
                    perkItemList[i].selectHighlight.SetActive(i == 0);
                    perkItemList[i].SetCallback(null, null, this.OnPerkItem, null);
                }
            }

            butPurchase.Init();
            if (butClose.rootObj != null)
            {
                butClose.Init();
            }

            UpdatePerkItemList();
            UpdateDisplay();

            if (demoMenu)
            {
                thisObj.SetActive(false);
            }
            //rectT.localPosition=new Vector3(0, 0, 0);
        }
示例#2
0
 public static void OnGameStarted()
 {
     instance.endTurnButton.rootObj.SetActive(true);
     instance.perkButton.rootObj.SetActive(UIMainControl.EnablePerkButton());
 }