void OnDifficultChanged(EM_STAGE_DIFFICULTTYPE difficultType) { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(mCurChapterId); if (chapterT == null) { Debug.LogError("章节数据错误id=" + mCurChapterId); return; } ObjectSelf.GetInstance().CurChapterLevel = (int)difficultType; UpdateHardBtnImgs(difficultType); //---------------关卡------------ //选中当前章节最后一个可以挑战的关卡; mCurLevelId = StageModule.GetLastStageIdInTheChapter(chapterT, difficultType); //---------------章节------------ UpdateChapter(chapterT); //-------------关卡详细描述------- UpdateLevelInfo(); //--------------所有关卡--------- UpdateLevels(chapterT); }
//刷新宝箱显示; void UpdateChapter(ChapterinfoTemplate chapterT) { //--------------翻页按钮----------- UpdatePageBtnState(); //--------------章节名字----------- m_title.text = string.Format(GameUtils.getString("chapter_title"), GameUtils.ConverIntToString(chapterT.getId())); m_value.text = GameUtils.getString(chapterT.getChapterName()); //--------------宝箱-------------- UpdateBox(chapterT); //--------------背景图------------ Sprite inst = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_guanqiabeijing"); ChapterinfoTemplate info = StageModule.GetChapterinfoTemplateById(chapterT.getId()); if (info != null) { //var info = (ChapterinfoTemplate)DataTemplate.GetInstance().m_ChapterTable.getTableData(chapterid); //var info = (ChapterinfoTemplate)table[chapterid]; Sprite pic = UIResourceMgr.LoadSprite(common.defaultPath + info.getBackgroundPicture()); mChapterBgImg.sprite = pic; //if (pic != null) //{ // item.AddComponent<Image>().sprite = Instantiate(pic, Vector3.zero, Quaternion.identity) as Sprite; //} //else //{ // item.AddComponent<Image>().sprite = Instantiate(inst, Vector3.zero, Quaternion.identity) as Sprite; //} } }
void OnChapterChanged(int curChapterId) { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(curChapterId); if (chapterT == null) { Debug.LogError("章节数据错误id=" + curChapterId); return; } ObjectSelf.GetInstance().SetCurChapterID(mCurChapterId); //---------------关卡难度--------- mDifficutType = EM_STAGE_DIFFICULTTYPE.NORMAL; UpdateHardBtnImgs(mDifficutType); UpdateDifficults(chapterT); //---------------章节------------ UpdateChapter(chapterT); //---------------关卡------------ //选中当前章节最后一个可以挑战的关卡; mCurLevelId = StageModule.GetLastStageIdInTheChapter(chapterT, mDifficutType); //----------- 关卡详细描述--------- UpdateLevelInfo(); //--------------所有关卡---------- UpdateLevels(chapterT); }
//protected override void OnClickWorldMap() //{ // UI_HomeControler.Inst.AddUI(UI_WordMap.UI_ResPath); // UI_HomeControler.Inst.ReMoveUI(UI_SelectLevelMgr.UI_ResPath); // UI_WorldMapManage._instance.WorldMapShow(); //} /// <summary> /// 判断当前章节,某个难度的关卡是否通关; /// </summary> /// <param name="chapterId"></param> /// <param name="type"></param> /// <returns></returns> bool CheckPrevStageIsPass(int chapterId, EM_STAGE_DIFFICULTTYPE type, out int prevStageId) { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(chapterId); prevStageId = -1; if (chapterT != null) { int stageId = StageModule.GetFirstStageIdInTheChapter(chapterT, type); StageTemplate st = StageModule.GetStageTemplateById(stageId); prevStageId = st.m_premissionid; ///前置关卡为-1时,表示不需要前置关卡,直接开启; if (prevStageId == -1) { return(true); } int star = -1; if (ObjectSelf.GetInstance().BattleStageData.IsCopyScenePass(prevStageId, out star)) { if (star > 0) { return(true); } } } return(false); }
void Init() { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(mCurChapterId); if (chapterT == null) { Debug.LogError("章节数据错误id=" + mCurChapterId); return; } UpdateHardBtnImgs(mDifficutType); //---------------------关卡难度----------------------- //m_normal.isOn = true; UpdateDifficults(chapterT); //---------------------章节-------------------------- UpdateChapter(chapterT); //--------------------- 关卡详细描述------------------- UpdateLevelInfo(); //---------------------所有关卡----------------------- UpdateLevels(chapterT); m_MapScroll.setIdx(mCurChapterId - 1); //特殊关卡计时; //if (ObjectSelf.GetInstance().BattleStageData.m_IsOpenSpecialStage) //{ // m_SpecialStageTime = ObjectSelf.GetInstance().BattleStageData.m_SpecialStage.m_Time; // m_CountDownObject.SetActive(true); // //m_CountDownText.text = string.Format("剩余时间:{0}:{1}", m_SpecialStageTime / 60, m_SpecialStageTime % 60); //} //else //{ // m_CountDownObject.SetActive(false); //} //// 新手引导相关--- 开启支线关卡 if (ObjectSelf.GetInstance().m_isOpenZhiXian) { for (int i = 0; i < stageDatas.Count; i++) { if (StageModule.GetStageType(stageDatas[i]) == EM_STAGE_TYPE.SIDE_QUEST) { OnLevelItemClick(stageDatas[i].m_stageid); } } } //新手引导 关卡选择 强制点击返回第一章 if (ObjectSelf.GetInstance().m_isOpenPerfectReward) { OnClickbackpoint(); } }
void OnStageDataRefreshed(GameEvent ge) { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(mCurChapterId); if (chapterT == null) { Debug.LogError("章节数据错误id=" + mCurChapterId); return; } UpdateLevels(chapterT); }
public void RefreshStageItem() { //OnChapterChanged(mCurChapterId); ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(mCurChapterId); if (chapterT == null) { Debug.LogError("章节数据错误id=" + mCurChapterId); return; } UpdateLevels(chapterT); }
public void OnClickBtn() { for (int i = 0; i < objList.Count; i++) { Destroy(objList[i]); } objList.Clear(); //UI_SelectFightArea sfight = UI_SelectFightArea.Inst; // char[] sfightList = sfight.iTotalCharpter[sfight.iChapterID].m_bRewardGot.ToString().ToCharArray(); int difficultLv = ObjectSelf.GetInstance().CurChapterLevel; int chapterId = ObjectSelf.GetInstance().GetCurChapterID(); ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(chapterId); if (chapterT != null) { int total = 0; int curstart = 0; StageModule.GetCurTotalStarsCount(chapterT, (EM_STAGE_DIFFICULTTYPE)difficultLv, out curstart, out total); if (total == curstart) { //TODO 宝箱弹窗 //if (isReward(ObjectSelf.GetInstance().CurChapterLevel, sfight.iTotalCharpter[sfight.iChapterID].m_bRewardGot)) if (StageModule.isReward(ObjectSelf.GetInstance().CurChapterLevel, ObjectSelf.GetInstance().BattleStageData.GetRewardGot(chapterId))) { UI_HomeControler.Inst.ReMoveUI(gameObject); } else { //与服务器交互 CGetStageReward cStage = new CGetStageReward(); cStage.difficulttype = (byte)ObjectSelf.GetInstance().CurChapterLevel; cStage.stageid = (byte)chapterId; IOControler.GetInstance().SendProtocol(cStage); UI_HomeControler.Inst.ReMoveUI(gameObject); } } else { UI_HomeControler.Inst.ReMoveUI(gameObject); } } else { UI_HomeControler.Inst.ReMoveUI(gameObject); } }
void OnRewardGot(GameEvent ge) { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(mCurChapterId); if (chapterT == null) { Debug.LogError("章节数据错误id=" + mCurChapterId); return; } UpdateBox(chapterT); //打开宝箱物品获得窗; int boxIdx = System.Convert.ToInt32(ge.data); UICommonManager.Inst.ShowRewardView(chapterT.getChapterDrop()[boxIdx]); }
void OnLevelChanged(int levelId) { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(mCurChapterId); if (chapterT == null) { Debug.LogError("章节数据错误id=" + mCurChapterId); return; } ObjectSelf.GetInstance().CurStageID = mCurLevelId; ObjectSelf.GetInstance().SetCurCampaignID(mCurLevelId); ////---------------------所有关卡----------------------- //UpdateLevels(chapterT); UpdateSelectState(); }
void BoxHandler(int idx) { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(mCurChapterId); if (chapterT == null) { Debug.LogError("章节数据错误id=" + mCurChapterId); return; } //是否可以领取; int curStars = 0; int totalStars = 0; if (StageModule.GetCurTotalStarsCount(chapterT, mDifficutType, out curStars, out totalStars)) { //可领取; if (curStars >= chapterT.getStarnum()[idx]) { //判断是否领取了; if (ObjectSelf.GetInstance().BattleStageData.GetRewardGot(mCurChapterId, idx)) { InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("maoxianguanka5")); } else { //与服务器交互 CGetStageReward cStage = new CGetStageReward(); cStage.stageid = (byte)mCurChapterId; //cStage.difficulttype = (byte)ObjectSelf.GetInstance().CurChapterLevel; //TODO::临时这么写; cStage.difficulttype = (byte)idx; IOControler.GetInstance().SendProtocol(cStage); } } else //不可领取; { int dropId = chapterT.getChapterDrop()[idx]; UICommonManager.Inst.ShowRewardBox(dropId, chapterT.getStarnum()[idx]); } } }
void Init() { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(mCurChapterId); if (chapterT == null) { Debug.LogError("章节数据错误id=" + mCurChapterId); return; } UpdateHardBtnImgs(mDifficutType); //---------------------关卡难度----------------------- //m_normal.isOn = true; UpdateDifficults(chapterT); //---------------------章节-------------------------- UpdateChapter(chapterT); //---------------------所有关卡----------------------- UpdateLevels(chapterT); //// 新手引导相关--- 开启支线关卡 if (ObjectSelf.GetInstance().m_isOpenZhiXian) { for (int i = 0; i < stageDatas.Count; i++) { if (StageModule.GetStageType(stageDatas[i]) == EM_STAGE_TYPE.SIDE_QUEST) { OnLevelItemClick(stageDatas[i].m_stageid); } } } //新手引导 关卡选择 强制点击返回第一章 if (ObjectSelf.GetInstance().m_isOpenPerfectReward) { OnClickbackpoint(); } }
public void ShowBox() { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(mCurChapterId); //UpdateBox(chapterT); }
public override void InitUIView() { base.InitUIView(); ObjectSelf.GetInstance().SetIsPrompt(false); //ChapterinfoTemplate ct = DataTemplate.GetInstance().GetChapterTemplateByStageID(1310381000); ///// /////当前所打关卡没有解锁新关卡时,从战斗结算界面回到关卡选择界面时,选中的关卡仍为之前所打的那关, /////当前关卡打完后有新关卡解锁,返回关卡选择界面就跳到下一关(困难难度一样如此),若同时解锁了两个 /////关卡(主线和支线),返回关卡选择界面选中主线关 ///// if (NeedSpecialStage) { InitLevelId = ObjectSelf.GetInstance().BattleStageData.GetSpecialStageData().m_StageID; } else { List <int> newStages = ObjectSelf.GetInstance().BattleStageData.GetNewStageList(); if (newStages != null && newStages.Count > 0) { DisplayNormal(); } else { if (ObjectSelf.GetInstance().CurStageID > 0 && StageModule.IsStageLevelById(ObjectSelf.GetInstance().CurStageID)) { InitLevelId = ObjectSelf.GetInstance().CurStageID; } else { DisplayNormal(); } } } if (InitLevelId <= 0) { if (InitChapterId <= 0) { DisplayNormal(); } else { ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(InitChapterId); if (chapterT == null) { DisplayNormal(); } else { mDifficutType = EM_STAGE_DIFFICULTTYPE.NORMAL; mCurChapterId = InitChapterId; mCurLevelId = StageModule.GetLastStageIdInTheChapter(chapterT, mDifficutType); } } } else { StageTemplate stageT = StageModule.GetStageTemplateById(InitLevelId); if (stageT == null) { DisplayNormal(); } else { mDifficutType = StageModule.GetStageDifficultType(stageT); mCurLevelId = InitLevelId; int chapterId = DataTemplate.GetInstance().GetChapterIdByStageT(stageT); if (chapterId == -1) { Debug.LogError("关卡stageid找不到对应的章节id,stageid=" + InitLevelId); } else { mCurChapterId = chapterId; } } } OnNewMapOpenShow(); Sprite inst = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_guanqiabeijing"); Dictionary <int, BattleStage> .KeyCollection keycoll = TotalCharpter.Keys; foreach (int chapterid in keycoll) { if (chapterid != 1001) { ChapterinfoTemplate info = StageModule.GetChapterinfoTemplateById(chapterid); if (info != null) { //var info = (ChapterinfoTemplate)DataTemplate.GetInstance().m_ChapterTable.getTableData(chapterid); //var info = (ChapterinfoTemplate)table[chapterid]; Sprite pic = UIResourceMgr.LoadSprite(common.defaultPath + info.getBackgroundPicture()); GameObject item = new GameObject("background"); if (pic != null) { item.AddComponent <Image>().sprite = Instantiate(pic, Vector3.zero, Quaternion.identity) as Sprite; } else { item.AddComponent <Image>().sprite = Instantiate(inst, Vector3.zero, Quaternion.identity) as Sprite; } item.transform.SetParent(mBgTrans, false); } } } Init(); // 新手引导 100302 if (GuideManager.GetInstance().isGuideUser&& GuideManager.GetInstance().IsContentGuideID(100302) == false) { GuideManager.GetInstance().ShowGuideWithIndex(100302); } }
public void SetTemplateData(StageTemplate data, EM_STAGE_STAGETYPE flag = EM_STAGE_STAGETYPE.NONE) { mStageT = data; if (data == null) { mGo.SetActive(false); return; } //如果是神秘商店特殊处理; if (flag == EM_STAGE_STAGETYPE.MYSTERIOUS) { m_TitleTxt.text = ""; mStarsImg[0].gameObject.SetActive(false); mStarsImg[1].gameObject.SetActive(false); mStarsImg[2].gameObject.SetActive(false); mIsNewImg.gameObject.SetActive(false); //这里data.m_stageid存的是场景id; ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(data.m_stageid); float[] val = chapterT.getShopposition(); Vector2 pos1 = new Vector2(val[0], val[1]); mGo.transform.localPosition = pos1; return; } //不是神秘商店另外处理; int chapterId = DataTemplate.GetInstance().GetChapterIdByStageT(data); EM_STAGE_TYPE type = StageModule.GetStageType(data); switch (type) { case EM_STAGE_TYPE.MAIN_QUEST1: case EM_STAGE_TYPE.MAIN_QUEST2: case EM_STAGE_TYPE.MAIN_QUEST3: //m_TitleTxt.text = string.Format("{0}-{1}", chapterId, StageModule.GetStageNumInChapter(data)); m_TitleTxt.text = StageModule.GetStageNumInChapter(data).ToString(); break; case EM_STAGE_TYPE.SIDE_QUEST: m_TitleTxt.text = GameUtils.getString("stage_type_branch"); break; //case EM_STAGE_TYPE.SPEC_QUEST: // break; //case EM_STAGE_TYPE.ACTIVE_QUEST_DIJING: // break; //case EM_STAGE_TYPE.ACTIVE_QUEST_YANLONG: // break; //case EM_STAGE_TYPE.LIMIT_TEST: // break; //case EM_STAGE_TYPE.BOSS_SHOUWANGZHE: // break; //case EM_STAGE_TYPE.BOSS_CHUANSHUO: // break; default: m_TitleTxt.text = ""; break; } //位置; Vector2 pos = new Vector2(data.getStageiconposition()[0], data.getStageiconposition()[1]); mGo.transform.localPosition = pos; m_Icon.sprite = UIResourceMgr.LoadSprite(common.defaultPath + data.m_stageicon); m_Icon.SetNativeSize(); float delta = (float)(data.getStageIconScale()) / 100f; m_Icon.transform.localScale = Vector3.one * delta; //是否已开启; if (ObjectSelf.GetInstance().BattleStageData.IsStageOpen(data.m_stageid)) { GameUtils.SetBtnSpriteGrayState(m_IconBtn, false); //星星; int starNum = 0; if (ObjectSelf.GetInstance().BattleStageData.IsCopyScenePass(data.m_stageid, out starNum)) { for (int i = 0; i < MaxStars; i++) { mStarsImg[i].gameObject.SetActive(false); } //switch (starNum) //{ // case 0: // mStarsImg[0].gameObject.SetActive(false); // mStarsImg[1].gameObject.SetActive(false); // mStarsImg[2].gameObject.SetActive(false); // break; // case 1: // mStarsImg[0].gameObject.SetActive(true); // mStarsImg[1].gameObject.SetActive(false); // mStarsImg[2].gameObject.SetActive(false); // break; // case 2: // mStarsImg[0].gameObject.SetActive(false); // mStarsImg[1].gameObject.SetActive(true); // mStarsImg[2].gameObject.SetActive(true); // break; // case 3: // mStarsImg[0].gameObject.SetActive(true); // mStarsImg[1].gameObject.SetActive(true); // mStarsImg[2].gameObject.SetActive(true); // break; // default: // mStarsImg[0].gameObject.SetActive(false); // mStarsImg[1].gameObject.SetActive(false); // mStarsImg[2].gameObject.SetActive(false); // break; //} if (starNum > 0 && starNum <= 3) { mStarsImg[starNum - 1].gameObject.SetActive(true); } } else { mStarsImg[0].gameObject.SetActive(false); mStarsImg[1].gameObject.SetActive(false); mStarsImg[2].gameObject.SetActive(false); } } else { GameUtils.SetBtnSpriteGrayState(m_IconBtn, true); mStarsImg[0].gameObject.SetActive(false); mStarsImg[1].gameObject.SetActive(false); mStarsImg[2].gameObject.SetActive(false); } //是否限制次数关卡; if (data.m_limittime > 0) { StageData sd = ObjectSelf.GetInstance().BattleStageData.GetStageDataByStageId(data.m_stageid); int useTimes = sd == null ? 0 : sd.m_FightSum; mRemindTimes.text = (data.m_limittime - useTimes).ToString(); mRemindTitle.gameObject.SetActive(true); } else { mRemindTitle.gameObject.SetActive(false); } //是否是新开启的关卡; UpdateIsNew(); }
//public bool isReward(int difficulttype, int rewardnum) //{ // int reward = 0; // if (difficulttype == 1) // { // reward = rewardnum % 10; // } // else if (difficulttype == 2) // { // reward = rewardnum % 100 / 10; // } // else if (difficulttype == 3) // { // reward = rewardnum / 100; // } // return reward != 0; //} public void UpdateShow() { //Debug.Log(mGrid.transform.position); //mGrid.transform.position = new Vector3(-225.4f, -4.7f, -263.4f); //与服务器交互显示所得物品 //UI_SelectFightArea sfight = UI_SelectFightArea.Inst; int chapterId = ObjectSelf.GetInstance().GetCurChapterID(); int difficultLv = ObjectSelf.GetInstance().CurChapterLevel; ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(chapterId); if (chapterT != null) { int total = 0; int curstart = 0; StageModule.GetCurTotalStarsCount(chapterT, (EM_STAGE_DIFFICULTTYPE)difficultLv, out curstart, out total); if (curstart >= total) { //TODO 宝箱弹窗 //if (isReward(difficultLv, sfight.iTotalCharpter[sfight.iChapterID].m_bRewardGot)) if (StageModule.isReward(difficultLv, ObjectSelf.GetInstance().BattleStageData.GetRewardGot(chapterId))) { mHeader.text = GameUtils.getString("fight_bosbox_content"); mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze"); //mCloseText.text = "关 闭"; mCloseText.text = GameUtils.getString("common_button_close"); } else { mHeader.text = GameUtils.getString("sign_content5"); mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze"); //mCloseText.text = "领 取"; mCloseText.text = GameUtils.getString("common_button_receive"); } } else { mHeader.text = GameUtils.getString("fight_bosbox_content"); mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze"); //mCloseText.text = "关 闭"; mCloseText.text = GameUtils.getString("common_button_close"); } innerdropIDList.Clear(); //int[] chapterDropList = ((ChapterinfoTemplate)DataTemplate.GetInstance().m_ChapterTable.getTableData(sfight.iChapterID)).getChapterDrop(); //int chapterDropID = chapterDropList[difficultLv - 1]; //int[] innerdropList = ((NormaldropTemplate)DataTemplate.GetInstance().m_NormaldropTable.getTableData(chapterDropID)).getInnerdrop(); //Dictionary<int, IExcelBean> innerIExcel = DataTemplate.GetInstance().m_InnerdropTable.getData(); ////List<InnerdropTemplate> innerdropIDList = new List<InnerdropTemplate>(); //for (int i = 0; i < innerdropList.Length; i++) //{ // foreach (var item in innerIExcel.Values) // { // if (((InnerdropTemplate)item).getInnerdropid() == innerdropList[i]) // { // innerdropIDList.Add((InnerdropTemplate)item); // } // } //} //ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(ObjectSelf.GetInstance().GetCurChapterID()); //if (chapterT == null) //{ // LogSystem.LogManager.LogToFile("战斗奖励界面失败---ChapterinfoTemplate is NULL. id=" + chapterId); // return; //} int dropId = difficultLv - 1; if (chapterT.getChapterDrop().Length <= 0) { LogSystem.LogManager.LogToFile("战斗奖励界面失败---ChapterinfoTemplate 中章节掉落包数组是空的. id=" + chapterId); return; } int chapterDropId = chapterT.getChapterDrop()[dropId]; NormaldropTemplate normalT = DataTemplate.GetInstance().GetNormaldropTemplateById(chapterDropId); if (normalT == null) { LogSystem.LogManager.LogToFile("战斗奖励界面失败---ChapterinfoTemplate is NULL. id=" + chapterDropId); return; } int[] innerDropList = normalT.getInnerdrop(); for (int i = 0, j = innerDropList.Length; i < j; i++) { foreach (int k in DataTemplate.GetInstance().m_InnerdropTable.GetDataKeys()) { InnerdropTemplate _it = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(k); if (_it == null) { continue; } if (_it.getInnerdropid() == innerDropList[i]) { innerdropIDList.Add(k); } } } } //char[] sfightList = sfight.iTotalCharpter[sfight.iChapterID].m_bRewardGot.ToString().ToCharArray(); else { mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze"); //mCloseText.text = "关 闭"; mCloseText.text = GameUtils.getString("common_button_close"); for (int i = 0; i < UI_SacredAltar._instance.m_FallItemList.Count; i++) { //InnerdropTemplate item = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(UI_SacredAltar._instance.m_FallItemList[i]); //InnerdropTemplate item = DataTemplate.GetInstance().GetInnerdropTemplateById(UI_SacredAltar._instance.m_FallItemList[i]); innerdropIDList.Add(UI_SacredAltar._instance.m_FallItemList[i]); } } for (int i = 0; i < innerdropIDList.Count; i++) { m_Cell = UniversalItemCell.GenerateItem(mGrid.transform); InnerdropTemplate value = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(innerdropIDList[i]); if (value == null) { return; } int itemid = value.getObjectid();//掉落物ID int type = value.getObjectid() / 1000000; m_Cell.AddClickListener(ShowItemPreviewUIHandler); switch (type) { case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RES: ResourceindexTemplate _temp_res = (ResourceindexTemplate)DataTemplate.GetInstance().m_ResourceindexTemplate.getTableData(itemid); if (_temp_res != null) { m_Cell.InitByID(itemid, value.getDropnum()); m_Cell.SetText(GameUtils.getString(_temp_res.getName()), "", ""); } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RUNE: //符文 { ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid); if (itemTable != null) { m_Cell.InitByID(itemid, -1); m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", ""); } } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_COMMON: { ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid); if (itemTable != null) { m_Cell.InitByID(itemid, value.getDropnum()); m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", ""); } } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_HERO: { HeroTemplate hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(itemid); if (hero != null) { m_Cell.InitByID(itemid, value.getDropnum()); m_Cell.SetText(GameUtils.getString(hero.getTitleID()), "", ""); } } break; default: break; } } }