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); }
public static void PropsacessHandler(int type, int data) { switch (type) { case 1: //副本; UI_HomeControler.Inst.RemoveAllUIButThis(new string[] { UI_MainHome.UI_ResPath }); UI_SelectLevelMgrNew.InitLevelId = data; UI_HomeControler.Inst.AddUI(UI_SelectLevelMgrNew.UI_ResPath); UI_HomeControler.Inst.AddUI(UI_Stage.UI_Res); StageTemplate stageT = StageModule.GetStageTemplateById(data); UI_Stage.Inst.Show(stageT); break; case 2: //66表--界面跳转表id; PropsjumpuiTemplate jumpUiT = DataTemplate.GetInstance().m_PropsacessTable.getTableData(data) as PropsjumpuiTemplate; if (jumpUiT != null) { UI_HomeControler.Inst.AddUI(jumpUiT.getJumpUIpath()); } break; default: LogManager.LogError("不支持的获得途径类型" + type); break; } }
public void setData(int iStageId) { iStageID = iStageId; mConsumePower.text = "0"; mRewardGold.text = "0"; mRewardExp.text = "0"; //StageTemplate stageinfo = (StageTemplate)DataTemplate.GetInstance().m_StageTable.getTableData(iStageID); StageTemplate stageinfo = StageModule.GetStageTemplateById(iStageID); //if (list.ContainsKey(iStageId)) { //StageTemplate stageinfo = (StageTemplate)list[iStageID]; if (stageinfo != null) { mStageDescription.text = GameUtils.getString(stageinfo.m_stageinfo); mConsumePower.text = stageinfo.m_cost.ToString(); mRewardGold.text = stageinfo.m_goldreward.ToString(); mRewardExp.text = stageinfo.m_heroexp.ToString(); if (expMoney != null) { if (stageinfo.m_expcrystal == -1) { expMoney.SetActive(false); } else { expMoney.SetActive(true); mRewarExpMoney.text = stageinfo.m_expcrystal.ToString(); } } } } }
//刷新宝箱显示; 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 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); }
bool IsLastChapter(int chapterId) { //int total = StageModule.GetChapterCount(); int total = StageModule.GetPlayerLastChapterID(); return(chapterId >= total); }
public static Props Props <TIn, TOut>(ActorMaterializer materializer, StageModule <TIn, TOut> op, Attributes parentAttributes, out object materialized) { var attr = parentAttributes.And(op.Attributes); // USE THIS TO AVOID CLOSING OVER THE MATERIALIZER BELOW // Also, otherwise the attributes will not affect the settings properly! var settings = materializer.EffectiveSettings(attr); Props result; materialized = null; if (op is IGroupBy) { var groupBy = (IGroupBy)op; result = GroupByProcessorImpl <TIn> .Props(settings, groupBy.MaxSubstreams, groupBy.Extractor); } else if (op.GetType().IsGenericType&& op.GetType().GetGenericTypeDefinition() == typeof(DirectProcessor <,>)) { throw new ArgumentException("DirectProcessor cannot end up in ActorProcessorFactory"); } else { throw new ArgumentException($"StageModule type {op.GetType()} is not supported"); } return(result); }
internal Source <TOut2, TMat> DeprecatedAndThen <TOut2>(StageModule <TOut, TOut2> op) { //No need to copy here, op is a fresh instance return(new Source <TOut2, TMat>(Module .Fuse(op, Shape.Outlet, op.In) .ReplaceShape(new SourceShape <TOut2>(op.Out)))); }
//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); }
internal Flow <TIn, TOut2, TMat> DeprecatedAndThen <TOut2>(StageModule <TOut, TOut2> op) { //No need to copy here, op is a fresh instance return(IsIdentity ? new Flow <TIn, TOut2, TMat>(op) : new Flow <TIn, TOut2, TMat>( Module.Fuse(op, Shape.Outlet, op.In).ReplaceShape(new FlowShape <TIn, TOut2>(Shape.Inlet, op.Out)))); }
//刷新难度标签; void UpdateDifficults(ChapterinfoTemplate chapterT) { int difficultCount = StageModule.GetDifficultCount(chapterT); m_normal.gameObject.SetActive(difficultCount >= 1); m_hard.gameObject.SetActive(difficultCount >= 2); m_hardest.gameObject.SetActive(difficultCount >= 3); }
public void onClick() { //if (isSelect) return; if (!isOpen) { if (mStageInfo.m_premissionid != -1) { ObjectSelf.GetInstance().SetCurCampaignID(iStageID); //StageTemplate newStage = (StageTemplate)DataTemplate.GetInstance().m_StageTable.getTableData(mStageInfo.m_premissionid); StageTemplate newStage = StageModule.GetStageTemplateById(mStageInfo.m_premissionid); //需修改 if (ObjectSelf.GetInstance().GetIsPrompt()) { UI_PromptFightArea.Inst.AddMsgBox(string.Format(GameUtils.getString("activitystage_tip1"), GameUtils.getString(newStage.m_stagename))); } else { string level = null; switch (ObjectSelf.GetInstance().CurChapterLevel) { case 1: level = GameUtils.getString("fight_stageselect_difficulty1"); break; case 2: level = GameUtils.getString("fight_stageselect_difficulty2"); break; case 3: level = GameUtils.getString("fight_stageselect_difficulty3"); break; default: break; } InterfaceControler.GetInst().AddMsgBox(string.Format(GameUtils.getString("fight_stageselect_tip3"), level, GameUtils.getString(newStage.m_stagename))); } //GameUtils.getString(newStage.m_stagename) } } else { ObjectSelf.GetInstance().SetCurCampaignID(iStageID); //if (UI_SelectFightArea.Inst != null) //{ // UI_SelectFightArea.Inst.onStageSelect(iStageID); //} //else { UI_PromptFightArea.Inst.onStageSelect(iStageID); } if (mTag.activeSelf) { mTag.SetActive(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(); } }
public void UpdatePerSec() { if (mStageT == null) { return; } //是不是神秘商店; if (StageModule.IsMysteriousShop(mStageT.m_stageid)) { SpecialStage ss = ObjectSelf.GetInstance().BattleStageData.GetSpecialStageData(); if (ss.m_Time <= 0) { mGo.SetActive(false); } return; } switch (StageModule.GetStageStageType(mStageT)) { case EM_STAGE_STAGETYPE.MAIN: case EM_STAGE_STAGETYPE.SIDE: break; case EM_STAGE_STAGETYPE.MYSTERIOUS: //神秘关卡计时; break; case EM_STAGE_STAGETYPE.SPECIAL: //特殊关卡计时; SpecialStage ss = ObjectSelf.GetInstance().BattleStageData.GetSpecialStageData(); if (ss.m_Time <= 0) { mGo.SetActive(false); } break; case EM_STAGE_STAGETYPE.ACTIVE: break; case EM_STAGE_STAGETYPE.BOSS: break; case EM_STAGE_STAGETYPE.LITMIT_TIMES: break; default: break; } }
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); }
void OnLevelItemClick(int stageId) { //判断是否是神秘商店(不在关卡表中就是神秘商店),是的话打开神秘商店界面; if (StageModule.IsMysteriousShop(stageId)) { UI_HomeControler.Inst.AddUI(UI_MysteriousShop.Path); return; } //判断当前关卡是否开启; if (ObjectSelf.GetInstance().BattleStageData.IsStageOpen(stageId)) { CurLevelID = stageId; } else { string difStr = ""; switch (mDifficutType) { case EM_STAGE_DIFFICULTTYPE.NONE: break; case EM_STAGE_DIFFICULTTYPE.NORMAL: difStr = GameUtils.getString("fight_stageselect_difficulty1"); break; case EM_STAGE_DIFFICULTTYPE.HARD: difStr = GameUtils.getString("fight_stageselect_difficulty2"); break; case EM_STAGE_DIFFICULTTYPE.HARDEST: difStr = GameUtils.getString("fight_stageselect_difficulty3"); break; default: break; } string preChapterName = ""; StageTemplate stageT = StageModule.GetStageTemplateById(stageId); if (stageT.m_premissionid != -1) { StageTemplate premStageT = StageModule.GetStageTemplateById(stageT.m_premissionid); preChapterName = GameUtils.getString(premStageT.m_stagename); } InterfaceControler.GetInst().AddMsgBox(string.Format(GameUtils.getString("fight_stageselect_tip3"), difStr, preChapterName)); } }
// ReSharper disable once UnusedMember.Local private IProcessor <TIn, TOut> ProcessorFor <TIn, TOut>(StageModule <TIn, TOut> op, Attributes effectiveAttributes, ActorMaterializerSettings settings, out object materialized) { DirectProcessor <TIn, TOut> processor; if ((processor = op as DirectProcessor <TIn, TOut>) != null) { var t = processor.ProcessorFactory(); materialized = t.Item2; return(t.Item1); } var props = ActorProcessorFactory.Props(_materializer, op, effectiveAttributes, out materialized); return(ActorProcessorFactory.Create <TIn, TOut>(_materializer.ActorOf(props, StageName(effectiveAttributes), settings.Dispatcher))); }
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 DisplayNormal() { mDifficutType = EM_STAGE_DIFFICULTTYPE.NORMAL; mCurLevelId = StageModule.GetPlayerLastLevelID(mDifficutType); if (mCurLevelId == -1) { mCurLevelId = 1310101000; } //最后一个章节; mCurChapterId = StageModule.GetPlayerLastChapterID(); if (mCurChapterId <= 0) { mCurChapterId = 1; } ObjectSelf.GetInstance().CurStageID = mCurLevelId; InitLevelId = mCurLevelId; InitChapterId = mCurChapterId; }
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 Show(StageTemplate stageT) { if (stageT == null) { Debug.LogError("关卡数据为null"); return; } mStageT = stageT; //-----------------星级----------------; StageData sd = ObjectSelf.GetInstance().BattleStageData.GetStageDataByStageId(stageT.m_stageid); int starNum = 0; if (sd != null) { starNum = sd.m_StageStar; } for (int i = 0; i < 3; i++) { StarImgs[i].gameObject.SetActive(i < starNum); } int stageNum = StageModule.GetStageNumInChapter(stageT); int chapterId = StageModule.GetChapterinfoIdByStageId(stageT.GetID()); m_ChapterNameTxt.text = string.Format(GameUtils.getString("chapter_title"), GameUtils.ConverIntToString(chapterId)); m_StageNameTxt.text = string.Format(GameUtils.getString("guanqia_mingzi"), stageNum, GameUtils.getString(stageT.m_stagename)); m_StageDescTxt.text = GameUtils.getString(stageT.m_stageinfo); m_ResourceCount1.text = stageT.m_playerexp.ToString(); m_ResourceCount2.text = stageT.m_goldreward.ToString(); if (stageT.m_expcrystal == -1) { ResouceObj3.SetActive(false); } else { ResouceObj3.SetActive(true); m_ResourceCount3.text = stageT.m_expcrystal.ToString(); } EM_STAGE_DIFFICULTTYPE difficultType = StageModule.GetStageDifficultType(stageT); string difficultStr = ""; switch (difficultType) { case EM_STAGE_DIFFICULTTYPE.NONE: break; case EM_STAGE_DIFFICULTTYPE.NORMAL: difficultStr = GameUtils.getString("chapter_difficult_type1"); break; case EM_STAGE_DIFFICULTTYPE.HARD: difficultStr = GameUtils.getString("chapter_difficult_type2"); break; case EM_STAGE_DIFFICULTTYPE.HARDEST: difficultStr = GameUtils.getString("chapter_difficult_type2"); break; default: break; } //-------------------关卡挑战次数-------------------- //无限制; if (stageT.m_limittime < 0) { SetRapidObjActive(false); } else { SetRapidObjActive(true); int remineTimes = Mathf.Max(0, stageT.m_limittime - sd.m_FightSum); TEXT_COLOR tc = TEXT_COLOR.WHITE; if (remineTimes > 0) { tc = TEXT_COLOR.WHITE; m_ResetBtn.gameObject.SetActive(false); } else { m_ResetBtn.gameObject.SetActive(true); tc = TEXT_COLOR.RED; } m_RemindTimeTxt.text = GameUtils.getString("fight_fightprepare_content3") + GameUtils.StringWithColor(remineTimes.ToString(), tc) + "/" + stageT.m_limittime; } m_DifficultTxt.text = difficultStr; //行动力不足颜色标红; if (isEnoughPow(mStageT)) { m_ConsumeCountTxt.text = stageT.m_cost.ToString(); } else { m_ConsumeCountTxt.text = GameUtils.StringWithColor(stageT.m_cost.ToString(), TEXT_COLOR.RED); } switch (stageT.m_winCondition) { case 1: m_SucessConditionTxt.text = "◆" + GameUtils.getString("System_setting_content28"); break; case 2: m_SucessConditionTxt.text = "◆" + string.Format(GameUtils.getString("System_setting_content29"), StageModule.GetBossName(stageT)); break; } //--------------------敌方英雄信息------------------; for (int i = 0; i < mEnermyList.Count; i++) { if (mEnermyList[i] != null) { mEnermyList[i].Destroy(); } } mEnermyList.Clear(); List <MonsterTemplate> _BossTemp = new List <MonsterTemplate>(); List <MonsterTemplate> _MonsterTemp = new List <MonsterTemplate>(); for (int i = 0, j = stageT.m_displayMonster.Length; i < j; i++) { MonsterTemplate _monster = (MonsterTemplate)DataTemplate.GetInstance().m_MonsterTable.getTableData(stageT.m_displayMonster[i]); if (_monster.getMonstertype() == 2) { _BossTemp.Add(_monster); } else { _MonsterTemp.Add(_monster); } } for (int i = 0; i < _BossTemp.Count; ++i) { UniversalItemCell cell = UniversalItemCell.GenerateItem(EnermyListTrans); cell.InitByID(_BossTemp[i].getId()); cell.SetSize(UniversalItemCell.UniversalItemSize.Type_114); cell.SetCount("BOSS"); cell.AddClickListener(OnClickUniversalHeroHandler); mEnermyList.Add(cell); } for (int i = 0; i < _MonsterTemp.Count; i++) { UniversalItemCell cell = UniversalItemCell.GenerateItem(EnermyListTrans); cell.InitByID(_MonsterTemp[i].getId()); cell.SetSize(UniversalItemCell.UniversalItemSize.Type_114); cell.AddClickListener(OnClickUniversalHeroHandler); //cell.SetCount("BOSS"); mEnermyList.Add(cell); } //--------------------关卡掉落展示------------------; for (int i = 0; i < mItemsList.Count; i++) { if (mItemsList[i] != null) { mItemsList[i].Destroy(); } } mItemsList.Clear(); string displaydrop = stageT.m_displaydrop; if (displaydrop == "-1" || string.IsNullOrEmpty(displaydrop)) { } else { string[] displaydropList = displaydrop.Split('#'); if (displaydropList.Length == 0) { return; } for (int i = 0; i < displaydropList.Length; i++) { UniversalItemCell cell = UniversalItemCell.GenerateItem(ItemListTrans); cell.SetSize(UniversalItemCell.UniversalItemSize.Type_114); cell.AddClickListener(OnClickUniversalItemHandler); string[] itemList = displaydropList[i].Split('-'); switch (int.Parse(itemList[0])) { case 1: int itemid = int.Parse(itemList[1]); if (int.Parse(itemList[2]) == 0) { //几率掉落; cell.InitByID(itemid); cell.SetText(null, GameUtils.getString("fight_stageselect_content3"), null); } else { //一定掉落; int count = System.Convert.ToInt32(itemList[3]); cell.InitByID(itemid, count); } break; case 2: if (int.Parse(itemList[2]) == 0) { cell.InitBySprite(UIResourceMgr.LoadSprite(common.defaultPath + itemList[1])); cell.SetText(null, GameUtils.getString("fight_stageselect_content3"), null); } else { int count = System.Convert.ToInt32(itemList[3]); cell.InitBySprite(UIResourceMgr.LoadSprite(common.defaultPath + itemList[1]), count); } break; default: break; } mItemsList.Add(cell); } } }
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); } }
void UpdateBox(ChapterinfoTemplate chapterT) { ResetBoxToZero(); //--------------宝箱-------------- int curStars = 0; int totalStars = 0; if (StageModule.GetCurTotalStarsCount(chapterT, mDifficutType, out curStars, out totalStars)) { m_curTxt.text = curStars.ToString(); m_totalTxt.text = "/" + totalStars; mScrollBar.value = (float)(curStars) / (float)(totalStars); int[] perStars = chapterT.getStarnum(); for (int i = 0, j = mBoxs.Count; i < j; i++) { //TODO::是否领取过---章节id,难度,第几个宝箱; bool isGot = StageModule.IsRewardGot(mCurChapterId); if (curStars >= perStars[i]) { if (isGot) { mBoxs[i].SetBoxImg(BoxSprite[1]); mBoxs[i].SetEffActive(false); } else { mBoxs[i].SetBoxImg(BoxSprite[0]); mBoxs[i].SetEffActive(true); } } else { //NoOpen; mBoxs[i].SetBoxImg(BoxSprite[0]); mBoxs[i].SetEffActive(false); } mBoxs[i].SetStarNum(perStars[i]); } //if (curStars >= totalStars) //{ // //是否领取过; // bool isGot = StageModule.IsRewardGot(mCurChapterId); // if (isGot) // { // m_BoxImg.sprite = BoxSprite[1]; // } // else // { // //宝箱震动; // InvokeRepeating("Shake", mShakeDelay, mShakeRate); // m_BoxImg.sprite = BoxSprite[0]; // } //} //else //{ // m_BoxImg.sprite = BoxSprite[0]; //} } else { Debug.LogError("数据错误"); } }
//刷新所有的levelitem; void UpdateLevels(ChapterinfoTemplate chapterT) { //获取当前章节所有的关卡列表; stageDatas = new List <StageTemplate>(); //章节的所有普通关卡--chapterInfo表中所有的关卡表; //主线; switch (DifficultType) { case EM_STAGE_DIFFICULTTYPE.NONE: break; case EM_STAGE_DIFFICULTTYPE.NORMAL: List <StageTemplate> datas1 = StageModule.GetStageDatas(chapterT, EM_STAGE_TYPE.MAIN_QUEST1); stageDatas = StageModule.AddList(stageDatas, datas1); //支线; List <StageTemplate> datas4 = StageModule.GetStageDatas(chapterT, EM_STAGE_TYPE.SIDE_QUEST); stageDatas = StageModule.AddList(stageDatas, datas4); break; case EM_STAGE_DIFFICULTTYPE.HARD: List <StageTemplate> datas2 = StageModule.GetStageDatas(chapterT, EM_STAGE_TYPE.MAIN_QUEST2); stageDatas = StageModule.AddList(stageDatas, datas2); break; case EM_STAGE_DIFFICULTTYPE.HARDEST: List <StageTemplate> datas3 = StageModule.GetStageDatas(chapterT, EM_STAGE_TYPE.MAIN_QUEST3); stageDatas = StageModule.AddList(stageDatas, datas3); break; default: break; } //章节的特殊关卡; SpecialStage ss = ObjectSelf.GetInstance().BattleStageData.GetSpecialStageData(); if (ss.m_StageID > 0 && (ss.m_BattlePieceNum == mCurChapterId)) { //特殊关卡; if (StageModule.IsStageTemplate(ss.m_StageID)) { StageTemplate st = StageModule.GetStageTemplateById(ss.m_StageID); stageDatas.Add(st); } //神秘商店; else { //构造一个神秘商店; StageTemplate st = new StageTemplate(); st.m_stageid = ss.m_BattlePieceNum; //章节id; st.m_mysteriousShop = ss.m_StageID; //神秘商店表格id; st.m_CustomData = true; stageDatas.Add(st); } } int adder = stageDatas.Count - mLevelItems.Count; if (adder > 0) { CreateLevels(adder); } for (int i = 0; i < mLevelItems.Count; i++) { if (i >= stageDatas.Count) { mLevelItems[i].SetTemplateData(null); } else { if (stageDatas[i].m_CustomData != null) { mLevelItems[i].SetTemplateData(stageDatas[i], EM_STAGE_STAGETYPE.MYSTERIOUS); } else { mLevelItems[i].SetTemplateData(stageDatas[i]); } mLevelItems[i].SetActive(true); } //设置选中状态; mLevelItems[i].SetSelectState(mCurLevelId); } }
private void OnClickRightBtn() { List <int> _tempList = m_MergeData[m_TeamId]; GameactivityTemplate _Data = (GameactivityTemplate)DataTemplate.GetInstance().m_GameactivityTable.getTableData(_tempList[0]); string[] jumpTypeArray = _Data.getJumpstype().Split('#'); if (int.Parse(jumpTypeArray[0]) == 1) { //弹出充值窗口 UI_HomeControler.Inst.AddUI(UI_QuikChargeMgr.UI_ResPath); } if (int.Parse(jumpTypeArray[0]) == 3) { //跳转到世界Boss GameObject go = UI_HomeControler.Inst.AddUI(UI_TestPanel.GetPath()); if (go) { go.GetComponent <UI_TestPanel>().GotoWorldBoss(); } OnClickReturnBtn(); } if (int.Parse(jumpTypeArray[0]) == 4) { //跳转到英雄招募 UI_HomeControler.Inst.AddUI(UI_Recruit.UI_ResPath); OnClickReturnBtn(); } if (int.Parse(jumpTypeArray[0]) == 5) { //跳转到遗迹宝藏 UI_HomeControler.Inst.AddUI(UI_Recruit.UI_ResPath); if (UI_Recruit.inst != null) { UI_Recruit.inst.OpenRelicBtn(); } OnClickReturnBtn(); } if (int.Parse(jumpTypeArray[0]) == 6) { UI_HomeControler.Inst.AddUI(UI_ShopMgr.UI_ResPath); UI_ShopMgr.SetCurShowTab(SHOP_TAB.SKIN); //跳转到商城时装 //UI_HomeControler.Inst.AddUI(UI_ShopMgr.UI_ResPath); //if (UI_ShopMgr.inst != null) //{ // UI_ShopMgr.inst.OnSkinToggleValueChanged(true); //} OnClickReturnBtn(); } if (int.Parse(jumpTypeArray[0]) == 7) { //跳转到商城礼包 UI_HomeControler.Inst.AddUI(UI_ShopMgr.UI_ResPath); UI_ShopMgr.SetCurShowTab(SHOP_TAB.GIFT); OnClickReturnBtn(); } if (int.Parse(jumpTypeArray[0]) == 8) { //跳转到商城道具 UI_HomeControler.Inst.AddUI(UI_ShopMgr.UI_ResPath); } if (int.Parse(jumpTypeArray[0]) == 9) { //跳转到神器 UI_HomeControler.Inst.AddUI(UI_Artifact.UI_ResPath); OnClickReturnBtn(); } if (int.Parse(jumpTypeArray[0]) == 10) { //跳转到符文熔炼 UI_HomeControler.Inst.AddUI(UI_RuneExp.UI_ResPath); OnClickReturnBtn(); } if (int.Parse(jumpTypeArray[0]) == 11) { //跳转到熔灵 UI_HomeControler.Inst.AddUI(UI_HeroLitholysin.UI_ResPath); OnClickReturnBtn(); } // 2 跳转到关卡章节 if (int.Parse(jumpTypeArray[0]) == 2) { //当前章节Id int _CurChapterId = StageModule.GetPlayerLastChapterID(); if (_CurChapterId < int.Parse(jumpTypeArray[1])) { InterfaceControler.GetInst().AddMsgBox("指定章节未开放", this.transform); return; } if (jumpTypeArray.Length >= 2) { if (int.Parse(jumpTypeArray[1]) == 1001) { ObjectSelf.GetInstance().SetIsPrompt(true); ObjectSelf.GetInstance().Week = ObjectSelf.GetInstance().GetWeek(); UI_HomeControler.Inst.AddUI(UI_PromptFightArea.UI_ResPath); OnClickReturnBtn(); } else { UI_SelectLevelMgrNew.InitChapterId = int.Parse(jumpTypeArray[1]); UI_HomeControler.Inst.AddUI(UI_SelectLevelMgrNew.UI_ResPath); OnClickReturnBtn(); } } } }