/// <summary> /// 显示礼物列表(滚动列表) /// </summary> void ShowGiftList() { giftList.ClearCells(); //giftList.totalCount = uIImpulseComponent.ImpulseGiftGoods.Count; giftList.totalCount = uIImpulseComponent.ImpulseGiftGoods.Count; giftList.RefillCells(); }
/// <summary> /// 获取许愿奖励配置 /// </summary> private void GetVowData() { LsSCVowAward.Clear(); LsSCVowAward.Add(sCVowAward); lsVow.ClearCells(); lsVow.totalCount = LsSCVowAward.Count; lsVow.RefillCells(); }
internal void SetManorRegionComponent(ManorRegionComponent manorRegionComponent) { this.manorRegionComponent = manorRegionComponent; TextRegion.text = $"{manorRegionComponent.regionId}"; //道具判定 var dealClass = StaticData.configExcel.GetAreaUnlockByID(manorRegionComponent.regionId).ConsumptionGood; LoopHorizontalScrollRect.totalCount = dealClass.Count; LoopHorizontalScrollRect.RefillCells(); }
internal void SetRewards(ManorRegionComponent manorRegionComponent, List <CSWareHouseStruct> awardIds, SCUnlockArea regionUnLockDialogEndSucc) { this.manorRegionComponent = manorRegionComponent; this.awardIds = awardIds; Root2dSceneManager._instance.awardIdsCurrManorRegion = awardIds; this.regionUnLockDialogEndSucc = regionUnLockDialogEndSucc; scrollReward.ClearCells(); scrollReward.totalCount = awardIds.Count; scrollReward.RefillCells(); }
public void SetData(UserBuyGameMallVo uservo, GameMallVo vo) { malltype = 0; _curMallVo = vo; _giftname.text = vo.MallName; _giftDesc.text = vo.MallDesc; _realPrice.text = vo.RealPrice.ToString(); _oldPrice.text = I18NManager.Get("Shop_RealPrice", vo.OriginalPrice); _awardList.UpdateCallback = UpdateAwardItem; _awardList.totalCount = vo.Award.Count; _awardList.RefreshCells(); _awardList.RefillCells(); }
public override void OnOpen() { base.OnOpen(); //表情包 emoji_data[] emojiDatas = EmojiDataConfig.Instance.GetAllData(); emojiViewList.totalCount = emojiDatas.Length; emojiViewList.RegisterInitCallback((Transform obj, int index) => { Function.SetImageSprite(obj.Find("Image").GetComponent <Image>(), emojiDatas[index].Icon); EventTrigger.Get(obj.gameObject).onClick = (cObj) => { TipsManager.ShowTips(Language.GetTextByKey(1)); }; }); emojiViewList.RefillCells(); }
/// <summary> /// 获取累积奖励配置 /// </summary> private void GetConfigData() { listSign.Clear(); var sign = StaticData.configExcel.SignIn; foreach (var item in sign) { listSign.Add(item); } //无限列表刷新 ls.ClearCells(); ls.totalCount = listSign.Count; ls.RefillCells(); }
public void OpenRootPlant(TileComponent tileComponent) { //打开种植的时候情况列表 Root2dSceneManager._instance.PlantData.PlantInfo.Clear(); currClickComponent = tileComponent; SetWorldPos(tileComponent, goPlant, TypePointUI.Plant); goPlant.SetActive(true); var listSeed = StaticData.GetPlantSeeds(); loopHorizontalScrollRect.ClearCells(); loopHorizontalScrollRect.totalCount = listSeed.Count; //计算适配器初始值 loopHorizontalScrollRect.GetComponent <UIPlantScrollViewAdapter>().CalcAdapterSizeByCount(listSeed.Count); //只有是显示状态刷新才有效 loopHorizontalScrollRect.RefillCells(); scrollCameraWhenBoundsOutScreenPlant.PlayCameraAnimWhenOutScreen(goPlant, tileComponent, TypePointUI.Plant); }
public void SetShowSelectItem(ElementTypePB elementType) { _imageList.RefillCells(); _diaryElementModel.GetElementByType(elementType, ElementModulePB.Diary, ref _unlockElementItemList, ref _lockElementItemList); _toggleSelectGroupBottom.Find("Image/Tips").gameObject.Hide(); if (elementType == ElementTypePB.Racket) { _lockElementItemList.Clear(); if (_unlockElementItemList.Count == 0) { _toggleSelectGroupBottom.Find("Image/Tips").gameObject.Show(); } } _imageList.totalCount = _lockElementItemList.Count + _unlockElementItemList.Count; _imageList.RefreshCells(); }
public void RefreshUI(rep_message_start_ready readyInfo) { struct_player_info opponentInfo = readyInfo.PlayerInfo; Debug.Log("UIReady.RefreshUI readyInfo = " + readyInfo); //我的头像 if (!string.IsNullOrEmpty(PlayerData.userIcon)) { var headIcon = transform.Find("PlayerInfo/LeftHeadImage/Mask/Image").GetComponent <Image>(); StartCoroutine(Function.DownloadImage(headIcon, PlayerData.userIcon)); } //对手头像 if (!string.IsNullOrEmpty(opponentInfo.UserIcon)) { var headIcon = transform.Find("PlayerInfo/RightHeadImage/Mask/Image").GetComponent <Image>(); StartCoroutine(Function.DownloadImage(headIcon, opponentInfo.UserIcon)); } //倒计时 float totalTime = (float)(readyInfo.StartTime - Function.GetServerTime()); Image countdownImage = transform.Find("Countdown/Bar").GetComponent <Image>(); Scheduler.Instance.CreateScheduler("UIReady.Countdown", 0, 0, 0.01f, (param) => { float lastTime = (float)(readyInfo.StartTime - Function.GetServerTime()); countdownImage.fillAmount = lastTime / totalTime; //Debug.Log("UIReady.Countdown lastTime = " + lastTime + " totalTime = " + totalTime); if (countdownImage.fillAmount <= 0) { Scheduler.Instance.Stop("UIReady.Countdown"); //请求开始 CommonRequest.ReqSatrtGame(readyInfo.Innings, (repMsg) => { //关闭UI //this.Close(); }); } }); //第几回合 transform.Find("Countdown/Text").GetComponent <Text>().text = Language.GetTextByKey(InningsTextKey[readyInfo.Innings]); //展示要随机的玩法 playViewList.RegisterInitCallback((Transform obj, int index) => { int playID = readyInfo.RandPlayId[index]; //获取配置 play_data playData = PlayDataConfig.Instance.GetDataByID(playID); //icon Function.SetImageSprite(obj.Find("Icon/Image").GetComponent <Image>(), playData.Icon); //名字 obj.Find("Name").GetComponent <Text>().text = playData.Name; }); //刷新列表 playViewList.totalCount = readyInfo.RandPlayId.Count; playViewList.RefillCells(); //随机选中玩法 int randCount = 0; Transform randRoot = transform.Find("RandPlay/Viewport/Content"); Scheduler.Instance.CreateScheduler("UIReady.RandPlay", 0, 0, 0.3f, (param) => { for (int idx = 0; idx < randRoot.childCount; idx++) { randRoot.GetChild(idx).Find("Icon/Choose").gameObject.SetActive(idx == randCount); } if (readyInfo.RandPlayId[randCount] == readyInfo.PlayId && readyInfo.StartTime - Function.GetServerTime() < 1.0) { //结束定时器 Scheduler.Instance.Stop("UIReady.RandPlay"); //播放一个放大效果 ScaleTo scaleTo = randRoot.GetChild(randCount).Find("Icon").GetComponent <ScaleTo>(); scaleTo.Play(); } randCount = (randCount + 1) % readyInfo.RandPlayId.Count; }); }
//好友庄园界面刷新 /// <summary> /// 生成庄园好友列表UI /// </summary> private void GenerateFriendStealListUI() { lsFriendStealList.ClearCells(); lsFriendStealList.totalCount = StaticData.playerInfoData.listFriendStealInfo.Count; lsFriendStealList.RefillCells(); }
// Start is called before the first frame update void Awake() { goRootSelfManor.SetActive(false); goRootFriendManor.SetActive(false); ButtonReturnMyManor.onClick.RemoveAllListeners(); ButtonReturnMyManor.onClick.AddListener(OnButtonReturnMyManorClick); ButtonDecorate.onClick.RemoveAllListeners(); ButtonDecorate.onClick.AddListener(OnButtonDecorateManor); //设置装饰物品 RefreshDecorateList(); loopHorizontalScrollRect.RefillCells(); buttonDecorateClose.onClick.RemoveAllListeners(); buttonDecorateClose.onClick.AddListener(OnButtonDecorateClose); buttonWareHouse.onClick.RemoveAllListeners(); buttonWareHouse.onClick.AddListener(OnButtonWareHouseClick); ButtonGainOneKey.onClick.RemoveAllListeners(); ButtonGainOneKey.onClick.AddListener(OnButtonGainOneKeyClick); ButtonStealOneKey.onClick.RemoveAllListeners(); ButtonStealOneKey.onClick.AddListener(OnButtonStealOneKeyClick); ButtonStore.onClick.RemoveAllListeners(); ButtonStore.onClick.AddListener(OnButtonStoreClick); ButtonDecorateToBuy.onClick.RemoveAllListeners(); ButtonDecorateToBuy.onClick.AddListener(OnButtonDecorateToBuyClick); ButtonRichman.onClick.RemoveAllListeners(); ButtonRichman.onClick.AddListener(OnButtonRichmanClick); //ButtonManorLog.onClick.RemoveAllListeners(); //ButtonManorLog.onClick.AddListener(OnButtonManorLogClick); ButtonOrder.onClick.RemoveAllListeners(); ButtonOrder.onClick.AddListener(OnButtonOrderClick); ButtonTask.onClick.RemoveAllListeners(); ButtonTask.onClick.AddListener(OnButtonTaskClick); ButtonFriend.onClick.RemoveAllListeners(); ButtonFriend.onClick.AddListener(OnButtonFriendClick); ButtonManorFriendClose.onClick.RemoveAllListeners(); ButtonManorFriendClose.onClick.AddListener(OnButtonManorFriendCloseClick); ButtonManorFriendOpen.onClick.RemoveAllListeners(); ButtonManorFriendOpen.onClick.AddListener(OnButtonManorFriendOpenClick); ButtonWateringOneKey.onClick.RemoveAllListeners(); ButtonWateringOneKey.onClick.AddListener(OnButtonWateringOneKeyClick); ButtonSign.onClick.RemoveAllListeners(); ButtonSign.onClick.AddListener(OnButtonSignClick); ButtonMail.onClick.RemoveAllListeners(); ButtonMail.onClick.AddListener(OnButtonMailClick); ButtonDressUp.onClick.RemoveAllListeners(); ButtonDressUp.onClick.AddListener(OnButtonDressUpClick); ButtonHeartBeat.onClick.RemoveAllListeners(); ButtonHeartBeat.onClick.AddListener(OnButtonHeartBeatClick); ButtonChapter.onClick.RemoveAllListeners(); ButtonChapter.onClick.AddListener(OnButtonChapterClick); RegisterDot(); UpdateRedDot(); //添加头像 goPlayerIcon = StaticData.CreatePlayerImage(transPlayerIconParent); //添加金币 goCoin = StaticData.CreateCoinNav(transCoinParent); goDiamond = StaticData.CreateDiamondNav(transDiamondParent); goWater = StaticData.CreateWaterNav(transWaterParent); //goUIChat goUIChat = StaticData.CreateUIChat(transChat); StaticData.AddUpdateDealTipsAction(UpdateOrderTips); }