Exemplo n.º 1
0
        public ListRuneGetWaysItem InitItemViewInfo(string sShowText)
        {
            if (string.IsNullOrEmpty(sShowText))
            {
                return(null);
            }

            if (DefaultGetWaysItem == null)
            {
                return(null);
            }

            GameObject getWaysObj = ResNode.InstantiateRes(DefaultGetWaysItem);

            if (!getWaysObj)
            {
                return(null);
            }

            ListRuneGetWaysItem item = getWaysObj.GetComponent <ListRuneGetWaysItem>();

            if (item == null)
            {
                return(null);
            }

            getWaysObj.SetActive(true);
            getWaysObj.transform.SetParent(this.transform, false);
            item.InitItemViewInfo(sShowText);

            return(item);
        }
Exemplo n.º 2
0
        public void ListRuneWaysInit()
        {
            if (ListRuneWays == null)
            {
                return;
            }

            ListRuneGetWaysItem item1 = ListRuneWays.InitItemViewInfo("请前往商城购买");
            ListRuneGetWaysItem item2 = ListRuneWays.InitItemViewInfo("解锁英雄等级获得");
            ListRuneGetWaysItem item3 = ListRuneWays.InitItemViewInfo("每日首胜获得");

            if (item1 == null || item2 == null || item3 == null)
            {
                return;
            }

            if (item1.WayButton == null || item2.WayButton == null || item3.WayButton == null)
            {
                return;
            }

            item1.WayButton.onClick.AddListener(OnRuneGotoShopViewClick);
            item2.WayButton.onClick.AddListener(OnRuneGotoKinViewClick);
            item3.WayButton.onClick.AddListener(OnRuneGotoMatchingViewClick);

            if (item1.WayToggle)
            {
                item1.WayToggle.isOn = true;
            }
        }