/// <summary> /// 格子UI事件委托 /// </summary> /// <param name="eventType"></param> /// <param name="data"></param> /// <param name="param"></param> private void OnGridUIEventDlg(UIEventType eventType, object data, object param) { switch (eventType) { case UIEventType.Click: { if (data is UIMallGrid) { UIMallGrid mallGrid = data as UIMallGrid; if (null != mallGrid) { SetSelectItemId(mallGrid.MallItemId); } } else if (data is UITabGrid) { UITabGrid tabGrid = data as UITabGrid; if (null != tabGrid) { SetActiveTab((int)tabGrid.Data); } } else if (data is UISplitGetGrid && null != param) { UISplitGetGrid getGrid = data as UISplitGetGrid; if (null != getGrid) { //点击icon弹出tips TipsManager.Instance.ShowItemTips(getGrid.BaseId, needCompare: false); } } } break; } }
void OnDailyTabGridUIEvent(UIEventType eventType, object data, object param) { switch (eventType) { case UIEventType.Click: if (data is UITabGrid) { UITabGrid g = data as UITabGrid; if (g.Data != null && g.Data is int) { int index = (int)g.Data; if (index < m_listDataType.Count) { SetActiveDailyTab(m_listDataType[index]); } } } if (data is UIDailyCalendarGrid) { UIDailyCalendarGrid grid = data as UIDailyCalendarGrid; ShowDailyActivityInfo(grid); } break; } }
/// <summary> /// grid点击事件 /// </summary> /// <param name="eventType"></param> /// <param name="data"></param> /// <param name="param"></param> private void OnGridUIEventDlg(UIEventType eventType, object data, object param) { switch (eventType) { case UIEventType.Click: if (data is UIHomeTradeBuyGrid) { UIHomeTradeBuyGrid buyGrid = data as UIHomeTradeBuyGrid; if (null != buyGrid) { SetSelectItem(buyGrid.MallItemId); } } else if (data is UIHomeTradeSellGrid) { UIHomeTradeSellGrid sellGrid = data as UIHomeTradeSellGrid; if (null != sellGrid) { SetSelectItem(sellGrid.MallItemId); } } else if (data is UITabGrid) { UITabGrid tabGrid = data as UITabGrid; if (null != tabGrid) { SetSelectTab((uint)tabGrid.Data); } } break; } }
/// <summary> /// UI格子事件委托 /// </summary> /// <param name="eventType"></param> /// <param name="data"></param> /// <param name="param"></param> private void OnUIGridEventDlg(UIEventType eventType, object data, object param) { if (null == data) { return; } switch (eventType) { case UIEventType.Click: { if (data is UIClanGrid) { UIClanGrid clanGrid = data as UIClanGrid; SetSelectClan(clanGrid.Data); } else if (data is UIClanSupportGrid) { UIClanSupportGrid clanGrid = data as UIClanSupportGrid; SetSelectSupportClan(clanGrid.Data); } else if (data is UITabGrid) { UITabGrid tab = data as UITabGrid; if (tab.Data is ClanCreateMode) { SetMode((ClanCreateMode)tab.Data); } } } break; } }
void OnTreasureBossGridUpdate(UIGridBase grid, int index) { if (grid is UITreasureBossGrid) { if (m_lst_TreasureDatas != null) { if (index < m_lst_TreasureDatas.Count) { uint id = m_lst_TreasureDatas[index]; if (id != 0) { UITreasureBossGrid listGrid = grid as UITreasureBossGrid; listGrid.SetGridData(id); listGrid.SetHightLight(false); if (index == 0) { SelectBossGrid(listGrid); } } } } } if (grid is UITabGrid) { UITabGrid g = grid as UITabGrid; int tabID = index + 1; if (tabDic.ContainsKey((uint)tabID)) { g.SetName(tabDic[(uint)tabID]); g.TabID = tabID; } } }
void SelectTab(int tabID, bool force = false) { if (m_ctor_TreasureTypeRoot == null) { return; } if (previousTab == tabID && force) { return; } //--------------------------------------------- UITabGrid tabGrid = m_ctor_TreasureTypeRoot.GetGrid <UITabGrid>((int)previousTab - 1 > 0 ? (int)previousTab - 1 : 0); if (tabGrid != null) { tabGrid.SetHightLight(false); } tabGrid = m_ctor_TreasureTypeRoot.GetGrid <UITabGrid>((int)tabID - 1 > 0 ? (int)tabID - 1 : 0); if (tabGrid != null) { tabGrid.SetHightLight(true); } CreateLeftList(tabID); previousTab = tabID; }
/// <summary> /// 设置当前面板模式 /// </summary> /// <param name="mode"></param> private void SetMode(ClanPanelMode mode, bool force = false) { if (mode == panelMode && !force) { return; } if (null != m_dic_clanPanlTabs) { UITabGrid tab = null; if (m_dic_clanPanlTabs.TryGetValue(panelMode, out tab)) { tab.SetHightLight(false); } if (m_dic_clanPanlTabs.TryGetValue(mode, out tab)) { tab.SetHightLight(true); } } panelMode = mode; UpdatePanelWidgetsVisibleStatus(); InitVisbileWidgets(); BuildModeData(); UpdatePanel(); SetApplyRedPoint(); }
private void UpdateApplyRedPoint() { UITabGrid tabGrid = null; if (IsPanelMode(ClanPanelMode.Member)) { m_dic_clanMemberTabs[ClanMemberMode.Apply].SetRedPointStatus(m_bool_showApplyRedPoint); } Dictionary <int, UITabGrid> dicTabs = null; if (dicUITabGrid.TryGetValue(1, out dicTabs)) { if (dicTabs != null && dicTabs.TryGetValue((int)ClanPanelMode.Member, out tabGrid)) { tabGrid.SetRedPointStatus(m_bool_showApplyRedPoint); } } //已读后隐藏主界面氏族红点显示 stShowMainPanelRedPoint st = new stShowMainPanelRedPoint() { modelID = (int)WarningEnum.Clan, direction = (int)WarningDirection.Left, bShowRed = m_bool_showApplyRedPoint, }; Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.MAINPANEL_SHOWREDWARING, st); }
void OnUpdataGridData(UIGridBase grid, int index) { if (grid is UIDeliverGrid) { UIDeliverGrid tab = grid as UIDeliverGrid; if (index < m_lstTransfers.Count) { tab.SetGridData(index); tab.SetData(m_lstTransfers[index]); } } if (grid is UITabGrid) { UITabGrid tab = grid as UITabGrid; if (index < m_lst_TabType.Count) { tab.SetGridData(index); if (m_dic_TabName.ContainsKey(m_lst_TabType[index])) { tab.SetName(m_dic_TabName[m_lst_TabType[index]]); } tab.SetHightLight(index == activedIndex); } } }
void InitTabGrids() { GameObject RightTabsPrefab = UIManager.GetResGameObj(GridID.Righttabs); rightTabs = NGUITools.AddChild(UIRootHelper.Instance.StretchTransRoot.gameObject, RightTabsPrefab); if (rightTabs == null) { return; } Transform btnRoot = rightTabs.transform.Find("bg/btnRoot"); if (btnRoot == null) { return; } GameObject m_btnPrefab = UIManager.GetResGameObj(GridID.Togglepanel); for (int i = 0; i < m_lstTabGrid.Capacity; i++) { GameObject go = NGUITools.AddChild(btnRoot.gameObject, m_btnPrefab); go.transform.localPosition = new UnityEngine.Vector3(0, -i * 93, 0); UITabGrid grid = go.AddComponent <UITabGrid>(); go.SetActive(false); m_lstTabGrid.Add(grid); } rightTabs.SetActive(false); }
/// <summary> /// 商城格子UI事件委托 /// </summary> /// <param name="eventType"></param> /// <param name="data"></param> /// <param name="param"></param> private void OnGridUIEventDlg(UIEventType eventType, object data, object param) { switch (eventType) { case UIEventType.Click: if (data is UIMallGrid) { UIMallGrid mallGrid = data as UIMallGrid; if (null != mallGrid) { SetSelectItemId(mallGrid.MallItemId); } } else if (data is UITabGrid) { UITabGrid tabGrid = data as UITabGrid; if (null != tabGrid) { if (tabGrid.Data is int) { SetActiveTab((int)tabGrid.Data); } } } else if (data is UIToggleGrid) { UIToggleGrid tab = data as UIToggleGrid; SetActiveStore((GameCmd.CommonStore)(int) tab.Data); } break; } }
private void OnGridUpdate(UIGridBase gridBase, int index) { if (gridBase is UITabGrid) { UITabGrid tGrid = gridBase as UITabGrid; Category c = null; if (category.TryGetCategory(selectfTabID, out c)) { Category s = c.ChildCategoryData[index]; tGrid.SetGridData(s.Id); tGrid.SetName(s.Name, 3); tGrid.SetHightLight(s.Id == selectsTabID); } } else if (gridBase is UIExchangeGrid) { UIExchangeGrid eGrid = gridBase as UIExchangeGrid; Category f = null; Category s = null; if (category.TryGetCategory(selectfTabID, out f) && f.TryGetCategory(selectsTabID, out s)) { eGrid.SetGridData(s.Datas[index]); eGrid.SetHightLight(s.Datas[index] == selectExchangeId); } } }
/// <summary> /// 设置活动标签 /// </summary> /// <param name="tabId"></param> public void SetActiveTab(int tabId, bool force = false) { if (tabId == activeTabId && !force) { return; } if (null != m_ctor_CategoryTagContent) { if (m_lst_mallTabDatas == null) { StructTabData(); } UITabGrid grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(activeTabId)); if (null != grid) { grid.SetHightLight(false); } grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(tabId)); if (null != grid) { grid.SetHightLight(true); } } activeTabId = tabId; //手动设置二级页签 dicActiveTabGrid[2] = tabId; CreateMallUIList(); }
/// <summary> /// /// </summary> /// <param name="mode"></param> /// <param name="force"></param> private void SetMode(ClanDeclareMode mode, bool force = false) { if (m_em_cur == mode && !force) { return; } UITabGrid tabGrid = null; if (null != m_dic_tabs && m_dic_tabs.TryGetValue(m_em_cur, out tabGrid)) { tabGrid.SetHightLight(false); } if (null != m_dic_tabs && m_dic_tabs.TryGetValue(mode, out tabGrid)) { tabGrid.SetHightLight(true); } m_em_cur = mode; UpdateVisibleWidgets(); if (mode == ClanDeclareMode.History) { BuildHistoryList(); } else if (mode == ClanDeclareMode.Search) { ClearSearchInfo(); } }
/// <summary> /// 设置面板模式 /// </summary> /// <param name="mode"></param> private void SetConsignmentMode(ConsignmentPanelPageEnum mode, ConsignmentItemMode topTab = ConsignmentItemMode.Buy) { // if (m_em_mode == mode && m_saleUIToggle == topTab) // { // return; // } m_em_mode = mode; bool value = mode == ConsignmentPanelPageEnum.Page_Coin; m_trans_CurrencyContent.gameObject.SetActive(value); m_trans_ItemContent.gameObject.SetActive(!value); UITabGrid tab = null; int topTabIndex = (int)topTab - 1; if (value) { tab = tabCreator.GetGrid <UITabGrid>(topTabIndex); } else { tab = m_ctor_Toggles.GetGrid <UITabGrid>(topTabIndex); } if (tab != null) { tab.gameObject.SendMessage("OnClick", tab.gameObject, UnityEngine.SendMessageOptions.RequireReceiver); } }
private void InitFriendSecondTabs() { if (null == m_dicFriendTabGrid && null != m_trans_SecondTab) { m_dicFriendTabGrid = new Dictionary <SecondTab, UITabGrid>(); UITabGrid tabGrid = null; for (SecondTab i = SecondTab.None + 1; i < SecondTab.Max; i++) { Transform ts = m_trans_SecondTab.Find(i.ToString()); if (null == ts) { continue; } tabGrid = ts.GetComponent <UITabGrid>(); if (tabGrid == null) { tabGrid = ts.gameObject.AddComponent <UITabGrid>(); } if (tabGrid != null) { tabGrid.TabID = (int)i; tabGrid.SetHightLight(false); if (!m_dicFriendTabGrid.ContainsKey(i)) { m_dicFriendTabGrid.Add(i, tabGrid); tabGrid.RegisterUIEventDelegate(OnFriendSecondTabsEvent); } } } } }
/// <summary> /// 设置页签状态 /// </summary> /// <param name="status">页签状态</param> /// <param name="force">是否强制更新</param> private void SetStatus(MuhonPanel.TabMode status, bool force = false) { SetEvolvePre(false); if (this.status == status && !force) { return; } if (this.status == TabMode.JinHua) { ResetEvolveAnim(); } ResetAutoUseDQ(); ResetModulesStatus(); if (null != m_dic_tabs) { UITabGrid tab = null; if (m_dic_tabs.TryGetValue(this.status, out tab)) { tab.SetHightLight(false); } if (m_dic_tabs.TryGetValue(status, out tab)) { tab.SetHightLight(true); } } this.status = status; UpdateWidgetsVisbleStatus(); if (!IsMuhonListEmpty()) { InitStatusdWidgets(); UpdateDataUIByStatus(); } }
/// <summary> /// 设置活动标签 /// </summary> /// <param name="tabId"></param> public void SetActiveTab(int tabId, bool force = false, bool needFocus = false) { if (tabId == mActiveSecondTab && !force) { return; } if (null != m_ctor_CategoryTagContent) { UITabGrid grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(mActiveSecondTab)); if (null != grid) { grid.SetHightLight(false); } grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(tabId)); if (null != grid) { grid.SetHightLight(true); } if (needFocus) { m_ctor_CategoryTagContent.FocusGrid(m_lst_mallTabDatas.IndexOf(tabId)); } } mActiveSecondTab = tabId; //手动设置二级页签 dicActiveTabGrid[2] = tabId; CreateMallUIList(); }
private void InitWidgets() { m_mgr = DataManager.Manager <ClanManger>(); m_dic_clanPanlTabs = new Dictionary <ClanPanelMode, UITabGrid>(); m_dic_clanPanlTs = new Dictionary <ClanPanelMode, Transform>(); UITabGrid grid = null; Transform ts = null; if (null != m_trans_FunctioToggles && null != m_trans_LeftContent) { for (ClanPanelMode i = ClanPanelMode.None + 1; i < ClanPanelMode.Max; i++) { ts = m_trans_FunctioToggles.Find("Clan" + i.ToString()); if (null != ts) { grid = ts.GetComponent <UITabGrid>(); if (null == grid) { grid = ts.gameObject.AddComponent <UITabGrid>(); } grid.SetGridData(i); grid.RegisterUIEventDelegate(OnUIGridEventDlg); grid.SetHightLight(false); m_dic_clanPanlTabs.Add(i, grid); } ts = m_trans_LeftContent.Find(i.ToString() + "Content"); if (null != ts) { m_dic_clanPanlTs.Add(i, ts); } } } }
/// <summary> /// 点击列表数据格回调 /// </summary> /// <param name="eType">UIEvent</param> /// <param name="data">格子</param> /// <param name="param">参数</param> void OnClickDataListEventCallback(UIEventType eType, object data, object param) { switch (eType) { case UIEventType.Click: if (data is UIWeaponSoulInfoGrid) { UIWeaponSoulInfoGrid egrid = data as UIWeaponSoulInfoGrid; SetSelectId(egrid.QWThisId); } else if (data is UITabGrid) { UITabGrid tabGrid = data as UITabGrid; if (tabGrid.Data is TabMode) { if (IsMuhonListEmpty()) { TipsManager.Instance.ShowTips(LocalTextType.Local_TXT_Soul_OwnNoneNotice); } SetStatus((TabMode)tabGrid.Data); } } break; } }
/// <summary> /// 氏族信息tab事件委托 /// </summary> /// <param name="type"></param> /// <param name="data"></param> /// <param name="param"></param> private void OnInfoGridUIDlg(UIEventType type, object data, object param) { switch (type) { case UIEventType.Click: { if (data is UITabGrid) { UITabGrid tabGrid = (UITabGrid)data; ClanInfoMode mode = (ClanInfoMode)tabGrid.Data; if (mode != ClanInfoMode.None) { SetInfoMode(mode); } } else if (data is UIClanDeclareWarGrid) { UIClanDeclareWarGrid g = data as UIClanDeclareWarGrid; if (preDeclareWarGrid != null) { preDeclareWarGrid.SetSelect(false); } g.SetSelect(true); preDeclareWarGrid = g; } } break; } }
/// <summary> /// 页签红点提示 /// </summary> void UpdateRedPoint() { UITabGrid tabGrid = null; Dictionary <int, UITabGrid> dicTabs = null; if (dicUITabGrid.TryGetValue(1, out dicTabs)) { //属性 if (dicTabs != null && dicTabs.TryGetValue((int)PropPanelPageEnum.Page_Prop, out tabGrid)) { //tabGrid.SetRedPointStatus(); } //时装 if (dicTabs != null && dicTabs.TryGetValue((int)PropPanelPageEnum.Page_Fashion, out tabGrid)) { //tabGrid.SetRedPointStatus(); } //称号页签 if (dicTabs != null && dicTabs.TryGetValue((int)PropPanelPageEnum.Page_Title, out tabGrid)) { tabGrid.SetRedPointStatus(TManager.HaveNewTitle()); } } }
private void UpdateApplyRedPoint(FriendPanelPageEnum type) { UITabGrid tabGrid = null; Dictionary <int, UITabGrid> dicTabs = null; if (dicUITabGrid.TryGetValue(1, out dicTabs)) { if (dicTabs != null) { if (type == FriendPanelPageEnum.Page_邮箱) { bool value = DataManager.Manager <MailManager>().HaveMailCanGet; if (dicTabs.TryGetValue((int)FriendPanelPageEnum.Page_邮箱, out tabGrid)) { tabGrid.SetRedPointStatus(value); } } else { bool haveChat = privateChatManager.HaveMsgFromFriend; if (dicTabs.TryGetValue((int)FriendPanelPageEnum.Page_最近, out tabGrid)) { tabGrid.SetRedPointStatus(haveChat); } } } } }
void InitTabs() { UITabGrid tab1 = m_trans_BaseProp.gameObject.GetComponent <UITabGrid>(); if (tab1 == null) { tab1 = m_trans_BaseProp.gameObject.AddComponent <UITabGrid>(); } if (tab1 != null) { if (!m_titleTabs.ContainsKey(m_trans_BaseProp.gameObject)) { m_titleTabs.Add(m_trans_BaseProp.gameObject, tab1); tab1.RegisterUIEventDelegate(OnUITabGridEventDlg); tab1.TabID = 100; } } UITabGrid tab2 = m_trans_DetailProp.gameObject.GetComponent <UITabGrid>(); if (tab2 == null) { tab2 = m_trans_DetailProp.gameObject.AddComponent <UITabGrid>(); } if (tab2 != null) { if (!m_titleTabs.ContainsKey(m_trans_DetailProp.gameObject)) { m_titleTabs.Add(m_trans_DetailProp.gameObject, tab2); tab2.RegisterUIEventDelegate(OnUITabGridEventDlg); tab2.TabID = 101; } } }
private void OnUITabGridEventDlg(UIEventType eventType, object data, object param) { if (null == data) { return; } switch (eventType) { case UIEventType.Click: { if (data is UITabGrid) { UITabGrid tab = data as UITabGrid; if (tab.TabID == 100) { onClick_BaseProp_Btn(m_trans_BaseProp.gameObject); } else if (tab.TabID == 101) { onClick_DetailProp_Btn(m_trans_DetailProp.gameObject); } } } break; } }
protected override void OnLoading() { base.OnLoading(); RegisterGlobalUIEvent(true); m_lst_datas = new List <uint>(); if (null != m_input_Input) { m_input_Input.onChange.Add(new EventDelegate(() => { m_str_inpuSearchInfo = TextManager.GetTextByWordsCountLimitInUnicode(m_input_Input.value , TextManager.CONST_NAME_MAX_WORDS); m_input_Input.value = m_str_inpuSearchInfo; })); m_input_Input.onSubmit.Add(new EventDelegate(() => { m_str_inpuSearchInfo = TextManager.GetTextByWordsCountLimitInUnicode(m_input_Input.value , TextManager.CONST_NAME_MAX_WORDS); m_input_Input.value = m_str_inpuSearchInfo; })); } m_dic_tabs = new Dictionary <ClanDeclareMode, UITabGrid>(); m_dic_ts = new Dictionary <ClanDeclareMode, Transform>(); UITabGrid tab = null; Transform ts = null; for (ClanDeclareMode i = ClanDeclareMode.None + 1; i < ClanDeclareMode.Max; i++) { if (null != m_trans_ToggleContent) { ts = m_trans_ToggleContent.Find(i.ToString()); if (null == ts) { continue; } tab = ts.GetComponent <UITabGrid>(); if (null == tab) { tab = ts.gameObject.AddComponent <UITabGrid>(); } tab.SetGridData(i); tab.RegisterUIEventDelegate(OnGridEventDlg); m_dic_tabs.Add(i, tab); } if (null != m_trans_Content) { ts = m_trans_Content.Find(i.ToString()); if (null == ts) { continue; } m_dic_ts.Add(i, ts); } } SetMode(ClanDeclareMode.History, true); }
/// <summary> /// 仓库格子点击实现 /// </summary> /// <param name="eventType"></param> /// <param name="data"></param> /// <param name="param"></param> public void OnWareHouseGridUIEvent(UIEventType eventType, object data, object param) { switch (eventType) { case UIEventType.Click: { if (data is UIItemGrid) { UIItemGrid grid = data as UIItemGrid; if (!grid.Empty) { DataManager.Manager <KnapsackManager>().MoveItems(grid.Data.QWThisID, GameCmd.PACKAGETYPE.PACKAGETYPE_MAIN); } else if (grid.IsLock) { KnapsackDefine.LocalUnlockInfo unlcokInfo = m_kmgr.GetUnlockInfoByPackageType(m_em_activeWareHouse); int unlockNum = ((int)ItemDefine.TransformServerLocation2Local(grid.Location).Position.y + 1) - unlcokInfo.UnlockNum; if (unlockNum == 0) { Engine.Utility.Log.Warning(CLASS_NAME + "-> unlock grid failed,num = {0} data error!", unlockNum); return; } //解锁格子 DoUnlocKnapsackGrid(unlockNum, m_em_activeWareHouse); } } else if (data is UITabGrid) { UITabGrid tabGrid = data as UITabGrid; KnapsackDefine.LocalUnlockInfo localInfo = m_kmgr.GetUnlockInfoByPackageType((GameCmd.PACKAGETYPE)tabGrid.Data); if (null != localInfo && localInfo.IsUnlock) { SetWareHousePackage((GameCmd.PACKAGETYPE)tabGrid.Data); } else { TipsManager.Instance.ShowTips("购买皇令解锁仓库"); } } } break; case UIEventType.LongPress: { if (data is UIItemGrid) { UIItemGrid grid = data as UIItemGrid; if (!grid.Empty) { imgr.OnUIItemGridClicked(grid.Data.QWThisID); } } } break; } }
private void UpdateWareHouseStatus() { if (!IsInitMode(KnapsackStatus.WareHouse)) { return; } if (IsKnapsackStatus(KnapsackStatus.WareHouseNPC) || IsKnapsackStatus(KnapsackStatus.WareHouse)) { if (null != m_dic_wareHouseTabs) { UITabGrid tab = null; KnapsackDefine.LocalUnlockInfo localInfo = null; GameObject obj = null; bool visible = false; if (m_dic_wareHouseTabs.TryGetValue(GameCmd.PACKAGETYPE.PACKAGETYPE_STORE1, out tab)) { obj = tab.CacheTransform.Find("Content/Toggle/Lock").gameObject; if (null != obj) { localInfo = m_kmgr.GetUnlockInfoByPackageType(GameCmd.PACKAGETYPE.PACKAGETYPE_STORE1); visible = (null != localInfo) ? localInfo.IsUnlock : false; if (obj.activeSelf == visible) { obj.SetActive(!visible); } } } if (m_dic_wareHouseTabs.TryGetValue(GameCmd.PACKAGETYPE.PACKAGETYPE_STORE2, out tab)) { obj = tab.CacheTransform.Find("Content/Toggle/Lock").gameObject; if (null != obj) { localInfo = m_kmgr.GetUnlockInfoByPackageType(GameCmd.PACKAGETYPE.PACKAGETYPE_STORE2); visible = (null != localInfo) ? localInfo.IsUnlock : false; if (obj.activeSelf == visible) { obj.SetActive(!visible); } } } if (m_dic_wareHouseTabs.TryGetValue(GameCmd.PACKAGETYPE.PACKAGETYPE_STORE3, out tab)) { obj = tab.CacheTransform.Find("Content/Toggle/Lock").gameObject; if (null != obj) { localInfo = m_kmgr.GetUnlockInfoByPackageType(GameCmd.PACKAGETYPE.PACKAGETYPE_STORE3); visible = (null != localInfo) ? localInfo.IsUnlock : false; if (obj.activeSelf == visible) { obj.SetActive(!visible); } } } } } }
/// <summary> /// 设置活动标签 /// </summary> /// <param name="tabId"></param> public void SetActiveTab(int tabId, bool force = false, bool needFocus = false) { if (tabId == mActiveSecondTab && !force) { return; } if (null != m_ctor_CategoryTagContent) { UITabGrid grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(mActiveSecondTab)); if (null != grid) { grid.SetHightLight(false); } grid = m_ctor_CategoryTagContent.GetGrid <UITabGrid>(m_lst_mallTabDatas.IndexOf(tabId)); if (null != grid) { grid.SetHightLight(true); } if (needFocus) { m_ctor_CategoryTagContent.FocusGrid(m_lst_mallTabDatas.IndexOf(tabId)); } } mActiveSecondTab = tabId; //手动设置二级页签 dicActiveTabGrid[2] = tabId; //皇令 if (memActiveFirstTab == TabMode.HuangLing) { m_trans_HuangLing.gameObject.SetActive(true); m_trans_Mall.gameObject.SetActive(false); m_trans_Recharge.gameObject.SetActive(false); m_label_TipsLabel.text = DataManager.Manager <TextManager>().GetLocalText(LocalTextType.Local_TXT_Noble_1); CreateNobleGrids(); } //充值 else if (memActiveFirstTab == TabMode.ChongZhi) { m_trans_HuangLing.gameObject.SetActive(false); m_trans_Mall.gameObject.SetActive(false); m_trans_Recharge.gameObject.SetActive(true); CreateRechargeGrids(); } //商城相关 else { m_trans_HuangLing.gameObject.SetActive(false); m_trans_Mall.gameObject.SetActive(true); m_trans_Recharge.gameObject.SetActive(false); CreateMallUIList(); } }
private void SetMemberModeEnable(ClanMemberMode mode, bool visible) { UITabGrid grid = (m_dic_clanMemberTabs.ContainsKey(m_em_clanMemberMode)) ? m_dic_clanMemberTabs[m_em_clanMemberMode] : null; if (null != grid) { grid.SetHightLight(visible); } SetMemberModeWidgetVisble(mode, visible); }