예제 #1
0
 protected override void DealShowData()
 {
     if (Data is Dictionary <string, object> )
     {
         ExtractData data = new ExtractData(Data, GetType());
         if (ShowArea)
         {
             var visible = data.Visible;
             ShowArea.SetActive(visible);
             if (visible)
             {
                 if (Option)
                 {
                     _dataDic = data.DataDic;
                     Option.Clear();
                     foreach (var item in data.DataDic)
                     {
                         Option.AddItem(item.Key);
                     }
                     if (Option.items.Count > 0)
                     {
                         var showName = Option.items[0];
                         Option.Set(showName);
                         _curCostType = showName;
                         _curCostData = _dataDic[showName] as ExtractItemData;
                     }
                     else
                     {
                         YxDebug.LogError("Extract types count is zero,please check again!");
                     }
                 }
             }
         }
     }
 }
예제 #2
0
 protected override void DealShowData()
 {
     if (Data is Dictionary <string, object> )
     {
         ExtractData data = new ExtractData(Data, GetType());
         ViewVisible     = data.ExtractVisible;
         RecordVisible   = data.RecordVisible;
         BindCouldChange = data.CouldChangeBind;
         if (gameObject.activeInHierarchy)
         {
             StartCoroutine(OnVisibleAction.WaitExcuteCalls());
         }
         ExtracNotice.TrySetComponentValue(data.ExtractNotice);
         if (ViewVisible)
         {
             _dataDic = data.DataDic;
             if (Option)
             {
                 Option.Clear();
                 foreach (var item in data.DataDic)
                 {
                     Option.AddItem(item.Key);
                 }
                 if (Option.items.Count > 0)
                 {
                     var showName = Option.items[0];
                     Option.Set(showName);
                     _curCostType = showName;
                     _curCostData = _dataDic[showName] as ExtractItemData;
                 }
                 else
                 {
                     YxDebug.LogError("Extract types count is zero,please check again!");
                 }
             }
             else
             {
                 var tabWindow = MainYxView as YxTabPageWindow;
                 if (tabWindow)
                 {
                     List <TabData> datas = new List <TabData>();
                     foreach (var item in data.DataDic)
                     {
                         var     itemData = item.Value as ExtractItemData;
                         var     tabName  = itemData != null ? itemData.PlatformType: item.Key;
                         TabData tabData  = new TabData()
                         {
                             Name          = item.Key,
                             UpStateName   = string.Format(TabUpFormat, tabName),
                             DownStateName = string.Format(TabDownFormat, tabName),
                             Data          = item.Key
                         };
                         datas.Add(tabData);
                     }
                     tabWindow.TabDatas = datas.ToArray();
                     tabWindow.UpdateView();
                 }
             }
         }
     }
 }