public void SimpleRefresh(DailyGiftItemClass.dailyItemType rType, bool dinnerType = false) { switch (rType) { case DailyGiftItemClass.dailyItemType.dinnerType: for (int i = 0; i < dialyItemList.Count; i++) { if (dialyItemList [i].curType == rType) { DailyGiftItemClass tClass = dialyItemList [i].ReturnValue() as DailyGiftItemClass; if (dinnerType == false) //吃过 { tClass.canGet = false; tClass.id = 1; } else //开启 { tClass.canGet = true; tClass.id = 2; } dialyItemList [i].SetItemValue(tClass); } } this.ResortList(); break; case DailyGiftItemClass.dailyItemType.vipGiftType: for (int i = 0; i < dialyItemList.Count; i++) { if (dialyItemList [i].curType == rType) { if (Core.Data.ActivityManager.GetDailyGiftState(ActivityManager.vipLibaoType) != "1") { dialyItemList [i].gameObject.SetActive(false); } DailyGiftItemClass tCl = dialyItemList [i].ReturnValue() as DailyGiftItemClass; dialyItemList.Remove(dialyItemList [i]); for (int j = 0; j < curDailyGiftList.Count; j++) { if (curDailyGiftList [j].curItemType == tCl.curItemType) { curDailyGiftList.Remove(tCl); } } } } rewardsGroupGird.repositionNow = true; break; case DailyGiftItemClass.dailyItemType.monthGiftType: for (int i = 0; i < dialyItemList.Count; i++) { if (dialyItemList [i].curType == rType) { DailyGiftItemClass tClass = dialyItemList [i].ReturnValue() as DailyGiftItemClass; MonthGiftData td = Core.Data.ActivityManager.GetMonthStateData(); if (tClass.otherPara > 0) { if (td != null) { tClass.otherPara = td.lastDay; tClass.canGet = td.canGain == 1 ? true:false; } } } } this.ResortList(); break; } this.ShowTipCtrl(); }
public void SimpleRefresh(DailyGiftItemClass.dailyItemType rType, bool dinnerType = false) { switch (rType) { case DailyGiftItemClass.dailyItemType.dinnerType: for (int i = 0; i < dialyItemList.Count; i++) { if (dialyItemList [i].curType == rType) { DailyGiftItemClass tClass = dialyItemList [i].ReturnValue() as DailyGiftItemClass; if (dinnerType == false) //吃过 { tClass.canGet = false; tClass.id = 1; } else //开启 { tClass.canGet = true; tClass.id = 2; } dialyItemList [i].SetItemValue(tClass); } } this.ResortList(); break; case DailyGiftItemClass.dailyItemType.levelGiftType: for (int j = 0; j < dialyItemList.Count; j++) { if (dialyItemList [j].curType == rType) { DailyGiftItemClass tClass = dialyItemList[j].ReturnValue() as DailyGiftItemClass; tClass.id = ActivityNetController.UnGotGiftNum; List <ItemOfReward> tItemList = new List <ItemOfReward> (); List <int[]> tRewardList = Core.Data.ActivityManager.GetRewardData(tClass.id).reward; for (int i = 0; i < tRewardList.Count; i++) { ItemOfReward tIor = new ItemOfReward(); tIor.pid = tRewardList [i] [0]; tIor.num = tRewardList [i] [1]; tItemList.Add(tIor); } tClass.giftReward = tItemList; if (tClass.id <= Core.Data.playerManager.Lv) { tClass.canGet = true; } else { tClass.canGet = false; } dialyItemList [j].SetItemValue(tClass); } } this.ResortList(); break; case DailyGiftItemClass.dailyItemType.vipGiftType: for (int i = 0; i < dialyItemList.Count; i++) { if (dialyItemList [i].curType == rType) { if (Core.Data.ActivityManager.GetDailyGiftState(ActivityManager.vipLibaoType) != "1") { dialyItemList [i].gameObject.SetActive(false); } DailyGiftItemClass tCl = dialyItemList [i].ReturnValue() as DailyGiftItemClass; dialyItemList.Remove(dialyItemList [i]); for (int j = 0; j < curDailyGiftList.Count; j++) { if (curDailyGiftList [j].curItemType == tCl.curItemType) { curDailyGiftList.Remove(tCl); } } } } gridObj.repositionNow = true; break; case DailyGiftItemClass.dailyItemType.sevenGiftType: for (int i = 0; i < dialyItemList.Count; i++) { if (dialyItemList [i].curType == rType) { DailyGiftItemClass tClass = dialyItemList [i].ReturnValue() as DailyGiftItemClass; if (tClass.id == ActivityNetController.curSevenGetIndex) { for (int j = 0; j < curDailyGiftList.Count; j++) { if (curDailyGiftList [j].id == tClass.id) { curDailyGiftList.Remove(curDailyGiftList [j]); Destroy(dialyItemList [i].gameObject); dialyItemList.Remove(dialyItemList [i]); } } } } } gridObj.GetComponent <UIGrid> ().repositionNow = true; // this.ResortList (); break; case DailyGiftItemClass.dailyItemType.monthGiftType: for (int i = 0; i < dialyItemList.Count; i++) { if (dialyItemList [i].curType == rType) { DailyGiftItemClass tClass = dialyItemList [i].ReturnValue() as DailyGiftItemClass; tClass.id = 1; } } this.ResortList(); break; } SQYMainController.mInstance.UpdateDailyGiftTip(); }
public void Refresh() { if (myData != null) { curType = myData.curItemType; lblDesp.text = Core.Data.stringManager.getString(7376); UISprite sp_Btn = btnGet.GetComponent <UISprite>(); getVipBtn.gameObject.SetActive(false); lblCanGet.gameObject.SetActive(false); switch (curType) { case DailyGiftItemClass.dailyItemType.dinnerType: spIcon.spriteName = "meishi"; dinnerObj.SetActive(true); giftObj.SetActive(false); lblName.text = Core.Data.stringManager.getString(7378); btnGet.gameObject.SetActive(false); btnDinner.gameObject.SetActive(true); if (myData.canGet == true) { btnGet.isEnabled = true; btnDinner.isEnabled = true; dinnerTime.gameObject.SetActive(false); } else { dinnerTime.gameObject.SetActive(true); btnDinner.isEnabled = false; } UISprite tSp = dinnerObj.GetComponentInChildren <UISprite> (); if (myData.id == 1) { if (tSp != null) { tSp.spriteName = "chilamian-3"; } } else { if (tSp != null) { tSp.spriteName = "chilamian-1"; } } int[] tNum = Core.Data.ActivityManager.GetDinnerTimeShow(); if (tNum != null) { dinnerTime.text = string.Format(Core.Data.stringManager.getString(7383), tNum[0].ToString() + ":00", tNum[1].ToString() + ":00"); } lblDesp.text = Core.Data.stringManager.getString(7377); lblDesp.color = new Color(1f, 0, 1f, 1f); break; case DailyGiftItemClass.dailyItemType.sevenGiftType: spIcon.spriteName = "qirilibao"; dinnerObj.SetActive(false); giftObj.SetActive(true); btnGet.gameObject.SetActive(true); string sNum = string.Format(Core.Data.stringManager.getString(7382), Core.Data.stringManager.getString(40000 + myData.id * 100)); lblName.text = sNum; if (myData.canGet == true) { sp_Btn.spriteName = s_canGet; btnGet.isEnabled = true; } else { lblCanGet.gameObject.SetActive(true); lblCanGet.text = Core.Data.stringManager.getString(7384); sp_Btn.gameObject.SetActive(false); } btnDinner.gameObject.SetActive(false); break; case DailyGiftItemClass.dailyItemType.monthGiftType: spIcon.spriteName = "shop-1012"; dinnerObj.SetActive(false); giftObj.SetActive(true); btnGet.gameObject.SetActive(true); lblName.text = Core.Data.stringManager.getString(7379); btnDinner.gameObject.SetActive(false); if (myData.id == 1) //购买过 { if (myData.canGet) { sp_Btn.gameObject.SetActive(true); sp_Btn.spriteName = s_canGet; lblCanGet.gameObject.SetActive(true); lblCanGet.text = string.Format(Core.Data.stringManager.getString(7408), myData.otherPara.ToString()); getVipBtn.gameObject.SetActive(false); } else { sp_Btn.gameObject.SetActive(true); sp_Btn.spriteName = s_canNotGet; lblCanGet.gameObject.SetActive(true); lblCanGet.text = string.Format(Core.Data.stringManager.getString(7408), myData.otherPara.ToString()); getVipBtn.gameObject.SetActive(false); } } else if (myData.id == 2) //未购买 { lblCanGet.gameObject.SetActive(true); lblCanGet.text = Core.Data.stringManager.getString(7384); getVipBtn.gameObject.SetActive(true); sp_Btn.gameObject.SetActive(false); } break; case DailyGiftItemClass.dailyItemType.vipGiftType: spIcon.spriteName = "viplongzhu"; dinnerObj.SetActive(false); giftObj.SetActive(true); lblName.text = Core.Data.stringManager.getString(7381); btnGet.gameObject.SetActive(true); if (myData.canGet) { sp_Btn.spriteName = s_canGet; } else { sp_Btn.spriteName = s_canNotGet; } btnDinner.gameObject.SetActive(false); break; case DailyGiftItemClass.dailyItemType.levelGiftType: spIcon.spriteName = "dengjijiangli"; dinnerObj.SetActive(false); giftObj.SetActive(true); lblName.text = string.Format(Core.Data.stringManager.getString(7380), myData.id.ToString() + Core.Data.stringManager.getString(7147)); btnGet.gameObject.SetActive(true); if (myData.canGet) { sp_Btn.spriteName = s_canGet; btnGet.isEnabled = true; } else { lblCanGet.gameObject.SetActive(true); lblCanGet.text = Core.Data.stringManager.getString(7384); sp_Btn.gameObject.SetActive(false); } btnDinner.gameObject.SetActive(false); break; default: break; } if (myData.giftReward != null) { SetGift(myData.giftReward.ToArray()); } else { giftObj.SetActive(false); } } }