/// <summary> /// 刷新剩余钱币爽 /// </summary> private void UpdateCurrencyLeft() { GameCmd.CommonStore activeStore = DataManager.Manager <MallManager>().BlackMarketActiveStore; bool visible = (activeStore == GameCmd.CommonStore.CommonStore_HundredThree)? false : true; if (null != m_trans_LeftCurrencyContent && m_trans_LeftCurrencyContent.gameObject.activeSelf != visible) { m_trans_LeftCurrencyContent.gameObject.SetActive(visible); } if (!visible) { return; } Client.IPlayer player = DataManager.Instance.MainPlayer; if (null == player) { return; } uint num = 0; string iconName = ""; switch (activeStore) { case GameCmd.CommonStore.CommonStore_HundredOne: iconName = MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Reputation); num = (uint)player.GetProp((int)Client.PlayerProp.Reputation); break; case GameCmd.CommonStore.CommonStore_HundredTwo: iconName = MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Score); num = (uint)player.GetProp((int)Client.PlayerProp.Score); break; case GameCmd.CommonStore.CommonStore_HundredFour: iconName = MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_CampCoin); num = (uint)player.GetProp((int)Client.PlayerProp.CampCoin); break; case GameCmd.CommonStore.CommonStore_HundredFive: iconName = MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_HuntingCoin); num = (uint)player.GetProp((int)Client.PlayerProp.ShouLieScore); break; } if (null != m_sprite_CurrncyIcon) { UIManager.GetAtlasAsyn(iconName, ref m_currencyCASD, () => { if (null != m_sprite_CurrncyIcon) { m_sprite_CurrncyIcon.atlas = null; } }, m_sprite_CurrncyIcon); } if (null != m_label_CurrncyNum) { m_label_CurrncyNum.text = num.ToString(); } }
/// <summary> /// 更新页签状态 /// </summary> private void UpdateTableStatus() { GameCmd.CommonStore activeStore = DataManager.Manager <MallManager>().BlackMarketActiveStore; foreach (KeyValuePair <GameCmd.CommonStore, UITabGrid> pair in m_dic_tabGrid) { pair.Value.SetHightLight(pair.Key == activeStore); } }
/// <summary> /// 格子UI事件 /// </summary> /// <param name="eventType"></param> /// <param name="data"></param> /// <param name="param"></param> private void OnGridUIEvent(UIEventType eventType, object data, object param) { switch (eventType) { case UIEventType.Click: if (data is UIBlackMarketGrid) { if (null != param) { if (param is UIItemInfoGrid) { UIBlackMarketGrid market = data as UIBlackMarketGrid; MallDefine.MallLocalData localData = DataManager.Manager <MallManager>().GetMallLocalDataByMallItemId(market.MallInfo.baseid); if (null != localData) { TipsManager.Instance.ShowItemTips(localData.LocalItem.BaseId); } } else if (param is GameCmd.DynaStorePosInfo) { PurchaseMallItem((GameCmd.DynaStorePosInfo)param); } } } else if (data is UICirclePointGrid) { UICirclePointGrid cGrid = data as UICirclePointGrid; if (null != cGrid.Data) { DataManager.Manager <MallManager>().SetActiveTabIndex((int)cGrid.Data); } } else if (data is UITabGrid) { UITabGrid tGrid = data as UITabGrid; if (null != tGrid.Data) { GameCmd.CommonStore store = (GameCmd.CommonStore)tGrid.Data; DataManager.Manager <MallManager>().SetBlackMarkeActiveStore(store); } } break; } }