From 554eda43e00d5817cd3e06a60e39d4bd882ee584 Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Wed, 25 Nov 2020 10:33:33 +0800 Subject: [PATCH] Merge branch 'master' of http://172.16.1.52:8090/r/GemBattle into master --- Assets/Scripts/Guide/GuideCtrl.cs | 181 +++++++++++++++++++++++++++++++------------- 1 files changed, 126 insertions(+), 55 deletions(-) diff --git a/Assets/Scripts/Guide/GuideCtrl.cs b/Assets/Scripts/Guide/GuideCtrl.cs index c09fc1c..7d821cc 100644 --- a/Assets/Scripts/Guide/GuideCtrl.cs +++ b/Assets/Scripts/Guide/GuideCtrl.cs @@ -41,9 +41,12 @@ EventCenter.Ins.Add((int)KTGMGemClient.EventType.KillDone, KillDone); EventCenter.Ins.Add((int)KTGMGemClient.EventType.GetOneTowerPos, GetOneTowerPos); EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateWaterLv1, CreateWaterLv1); - EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillStep, SkillStep); - EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillRelease, SkillRelease); - EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillReleaseDone, SkillReleaseDone); + //EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillStep, SkillStep); + EventCenter.Ins.Add((int)KTGMGemClient.EventType.DragStep, DragStep); + EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateThirdWaveDone, CreateThirdWaveDone); + + //EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillRelease, SkillRelease); + //EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillReleaseDone, SkillReleaseDone); } @@ -55,34 +58,19 @@ EventCenter.Ins.Remove((int)KTGMGemClient.EventType.KillDone, KillDone); EventCenter.Ins.Remove((int)KTGMGemClient.EventType.GetOneTowerPos, GetOneTowerPos); EventCenter.Ins.Remove((int)KTGMGemClient.EventType.CreateWaterLv1, CreateWaterLv1); - EventCenter.Ins.Remove((int)KTGMGemClient.EventType.SkillStep, SkillStep); - EventCenter.Ins.Remove((int)KTGMGemClient.EventType.SkillRelease, SkillRelease); - EventCenter.Ins.Remove((int)KTGMGemClient.EventType.SkillReleaseDone, SkillReleaseDone); + //EventCenter.Ins.Remove((int)KTGMGemClient.EventType.SkillStep, SkillStep); + EventCenter.Ins.Remove((int)KTGMGemClient.EventType.DragStep, DragStep); + EventCenter.Ins.Remove((int)KTGMGemClient.EventType.CreateThirdWaveDone, CreateThirdWaveDone); + + //EventCenter.Ins.Remove((int)KTGMGemClient.EventType.SkillRelease, SkillRelease); + //EventCenter.Ins.Remove((int)KTGMGemClient.EventType.SkillReleaseDone, SkillReleaseDone); } public void Init(int step) { - //Time.timeScale = 0;//游戏暂停,这样会导致协程停止了 ChangeStep(GuideEnum.Step0); GameConfig.CanOpenNewTower = false; - // switch (step) - // { - // case 2: - // case 3: - // //生成两个火元素 - // break; - // case 4: - // //生成1个2级火元素,标记上阵位置 - - // break; - // case 5: - // //生成2级火元素塔,第一关小怪出木元素小怪 - - // break; - - // } - // ChangeStep((GuideEnum)(step + 1)); } @@ -98,13 +86,15 @@ allGuideDic.Add(GuideEnum.Step3, new string[] { }); allGuideDic.Add(GuideEnum.Step4, new string[] { GuideConfig.showWords[6] }); allGuideDic.Add(GuideEnum.Step5, new string[] { GuideConfig.showWords[7], GuideConfig.showWords[8] }); - allGuideDic.Add(GuideEnum.Step6, new string[] { GuideConfig.showWords[9], GuideConfig.showWords[10] }); - allGuideDic.Add(GuideEnum.Step7, new string[] { GuideConfig.showWords[11] }); - allGuideDic.Add(GuideEnum.Step8, new string[] { GuideConfig.showWords[12] }); + allGuideDic.Add(GuideEnum.Step6, new string[] { }); + allGuideDic.Add(GuideEnum.Step7, new string[] { }); + allGuideDic.Add(GuideEnum.Step8, new string[] { GuideConfig.showWords[9] }); allGuideDic.Add(GuideEnum.Step9, new string[] { }); - allGuideDic.Add(GuideEnum.Step10, new string[] { GuideConfig.showWords[13], GuideConfig.showWords[14] }); - allGuideDic.Add(GuideEnum.Step11, new string[] { GuideConfig.showWords[15] }); - allGuideDic.Add(GuideEnum.Step12, new string[] { GuideConfig.showWords[16], GuideConfig.showWords[17] }); + allGuideDic.Add(GuideEnum.Step10, new string[] { GuideConfig.showWords[10], GuideConfig.showWords[11] }); + allGuideDic.Add(GuideEnum.Step11, new string[] { }); + allGuideDic.Add(GuideEnum.Step12, new string[] { GuideConfig.showWords[12], GuideConfig.showWords[13] }); + allGuideDic.Add(GuideEnum.Step13, new string[] { }); + allGuideDic.Add(GuideEnum.Step14, new string[] { GuideConfig.showWords[14], GuideConfig.showWords[15] }); } @@ -159,6 +149,12 @@ case GuideEnum.Step12: Step12(); break; + case GuideEnum.Step13: + Step13(); + break; + case GuideEnum.Step14: + Step14(); + break; case GuideEnum.Finish: Finish(); break; @@ -176,7 +172,7 @@ isShowing = true; if (currentIndex == -1)//初始化本步 { - CommonDebugHelper.DebugError("第1步开始"); + CommonDebugHelper.DebugError("第1步开始, 对话"); TDAA_SDKManager.Ins.Statistics(5);//埋点 currentIndex = 0; @@ -193,7 +189,7 @@ { if (currentIndex == -1) { - CommonDebugHelper.DebugError("第2步开始"); + CommonDebugHelper.DebugError("第2步开始,购买火元素"); TDAA_SDKManager.Ins.Statistics(6);//埋点 TDAA_SDKManager.Ins.GuideStep(1);//埋点 @@ -240,7 +236,7 @@ isShowing = true; if (currentIndex == -1) { - CommonDebugHelper.DebugError("第3步开始"); + CommonDebugHelper.DebugError("第3步开始,介绍火元素"); TDAA_SDKManager.Ins.GuideStep(2);//埋点 currentIndex = 0; @@ -262,7 +258,7 @@ { if (currentIndex == -1) { - CommonDebugHelper.DebugError("第4步开始"); + CommonDebugHelper.DebugError("第4步开始,引导合成火元素"); TDAA_SDKManager.Ins.GuideStep(3);//埋点 currentIndex = 0; @@ -295,7 +291,7 @@ { if (currentIndex == -1) { - CommonDebugHelper.DebugError("第5步开始"); + CommonDebugHelper.DebugError("第5步开始,上阵火元素 "); TDAA_SDKManager.Ins.GuideStep(4);//埋点 currentIndex = 0; @@ -317,7 +313,7 @@ { if (currentIndex == -1) { - CommonDebugHelper.DebugError("第6步开始"); + CommonDebugHelper.DebugError("第6步开始,开打第一波"); TDAA_SDKManager.Ins.GuideStep(5);//埋点 EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.CreateFirstWave); @@ -345,7 +341,7 @@ { if (currentIndex == -1) { - CommonDebugHelper.DebugError("第7步开始"); + CommonDebugHelper.DebugError("第7步开始,出怪"); TDAA_SDKManager.Ins.GuideStep(6);//埋点 panel.SetGuideUI(false); @@ -365,11 +361,15 @@ private void KillDone() { - currentIndex = 0; - needIndex = 2; - panel.SetGuideUI(true); - isShowing = true; - panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack); + currentIndex = -1; + + ChangeStep(GuideEnum.Step7); + + // currentIndex = 0; + // needIndex = 2; + // panel.SetGuideUI(true); + // isShowing = true; + // panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack); } @@ -377,16 +377,20 @@ { if (currentIndex == -1) { - CommonDebugHelper.DebugError("第8步开始"); + CommonDebugHelper.DebugError("第8步开始,跳过了"); TDAA_SDKManager.Ins.GuideStep(7);//埋点 currentIndex = 0; needIndex = 1; panel.SetGuideUI(false); - GameConfig.CanOpenNewTower = true; + + //GameConfig.CanOpenNewTower = true; //等待解锁塔 - panel.Step7(currentIndex, allGuideDic[currentStep][currentIndex]); + //panel.Step7(currentIndex, allGuideDic[currentStep][currentIndex]); + + //第一排直接开过塔了,引导买水元素 + GetOneTowerPos(); } } @@ -404,7 +408,7 @@ isShowing = true; if (currentIndex == -1)//初始化本步 { - CommonDebugHelper.DebugError("第9步开始"); + CommonDebugHelper.DebugError("第9步开始,介绍水元素"); TDAA_SDKManager.Ins.GuideStep(8);//埋点 GameConfig.CanOpenNewTower = false; @@ -422,7 +426,7 @@ { if (currentIndex == -1) { - CommonDebugHelper.DebugError("第10步开始"); + CommonDebugHelper.DebugError("第10步开始,购买水元素,第二步上阵"); TDAA_SDKManager.Ins.GuideStep(9);//埋点 currentIndex = 0; @@ -458,12 +462,18 @@ ChangeStep(GuideEnum.Step10); } + private void DragStep() + { + currentIndex = -1; + ChangeStep(GuideEnum.Step10); + } + private void Step10() { isShowing = true; if (currentIndex == -1)//初始化本步 { - CommonDebugHelper.DebugError("第11步开始"); + CommonDebugHelper.DebugError("第11步开始,自己编的,需要修改,反正就是引导换位置"); TDAA_SDKManager.Ins.GuideStep(10);//埋点 currentIndex = 0; @@ -475,7 +485,7 @@ else if (currentIndex == 1) { panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack); - panel.Step10(); + //panel.Step10(); } } @@ -483,13 +493,13 @@ { if (currentIndex == -1) { - CommonDebugHelper.DebugError("第12步开始"); + CommonDebugHelper.DebugError("第12步开始,已经换了位置"); TDAA_SDKManager.Ins.GuideStep(11);//埋点 currentIndex = 0; needIndex = 1; - panel.Step11(currentIndex, allGuideDic[currentStep][currentIndex]); + panel.Step11Drag(currentIndex); } } @@ -497,13 +507,27 @@ //开始拖拽 public void BeginDrag11_1() { - panel.Step11(1, ""); + panel.Step11Drag(1); } //结束推拽 没有合成,回到上一步 public void EndDrag11_1() { - panel.Step11(0, allGuideDic[currentStep][0]); + panel.Step11Drag(0); + } + + public void DragDone() + { + GameConfig.CanDragTower = false; + CommonDebugHelper.Debug("结束拖拽"); + panel.Step11Drag(2); + EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.RestartWave); + } + + private void CreateThirdWaveDone() + { + currentIndex = -1; + ChangeStep(GuideEnum.Step12); } private void SkillRelease() @@ -523,13 +547,61 @@ isShowing = true; if (currentIndex == -1)//初始化本步 { - CommonDebugHelper.DebugError("第13步开始"); + CommonDebugHelper.DebugError("第13步开始,对话框说明技能"); TDAA_SDKManager.Ins.GuideStep(12);//埋点 currentIndex = 0; needIndex = 2; panel.Step12(); + panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack); + } + else + { + panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack); + } + } + + private void Step13() + { + isShowing = true; + if (currentIndex == -1)//初始化本步 + { + CommonDebugHelper.DebugError("第14步开始,引导释放技能"); + TDAA_SDKManager.Ins.GuideStep(13);//埋点 + + currentIndex = 0; + needIndex = 2; + panel.Step13("释放技能", AfterSkillDone); + + } + } + + private void AfterSkillDone() + { + panel.CleanMask(); + StartCoroutine(ChangeState()); + } + + IEnumerator ChangeState() + { + CommonDebugHelper.Debug("释放技能结束,这里等了1秒钟"); + yield return new WaitForSeconds(1.0f); + currentIndex = -1; + ChangeStep(GuideEnum.Step14); + } + + private void Step14() + { + isShowing = true; + if (currentIndex == -1)//初始化本步 + { + CommonDebugHelper.DebugError("第15步开始,引导释放技能"); + TDAA_SDKManager.Ins.GuideStep(14);//埋点 + + currentIndex = 0; + needIndex = 2; + panel.Step14(); panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack); } else @@ -549,7 +621,6 @@ EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.GuideFinish); PlayerPrefs.SetInt("GemBattleGuide", 1); Destroy(gameObject); - //gameObject.SetActive(false); } #endregion -- Gitblit v1.9.1