wangguan
2020-12-16 67ee17292855d8ce2e077bea2f86113adadf839c
Assets/Scripts/Guide/GuideCtrl.cs
@@ -1,5 +1,4 @@
using System.Collections;
using System.Diagnostics;
using System.Collections.Generic;
using UnityEngine;
using KTGMGemClient;
@@ -12,11 +11,10 @@
    private static GuideCtrl ins;
    public static GuideCtrl Ins { get { return ins; } }
    GuidePanel panel;//UI
    GuidePanelNew panel;//UI
    Dictionary<GuideEnum, string[]> allGuideDic;
    GuideEnum currentStep;//当前引导到了第几步
    int currentIndex;//分解步骤
    int needIndex;//当前步骤中需要多少分步
    /// <summary>
    /// Awake is called when the script instance is being loaded.
@@ -26,61 +24,49 @@
        ins = this;
        AddDic();
        currentStep = GuideEnum.None;
        currentIndex = -1;
        panel = gameObject.AddComponent<GuidePanel>();
        panel = gameObject.AddComponent<GuidePanelNew>();
    }
    private void Start()
    {
        //int step = PlayerPrefs.GetInt("GemBattleGuide");
        TDAA_SDKManager.Ins.Statistics(5);//埋点
        Init(0);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.AddCard, AddCard);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateFireLv2, CreateFireLv2);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.ChargingEnd, ChargingEnd);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateWoodLv2, CreateWoodLv2);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.KillDone, KillDone);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.GetOneTowerPos, GetOneTowerPos);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateFireLv1, CreateFireLv1);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateWaterLv1, CreateWaterLv1);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillStep, SkillStep);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillReleaseDone, SkillReleaseDone);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.DragStep, DragStep);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.KillSecondDone, KillSecondDone);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.KillThirdDone, KillThirdDone);
        EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateFourthWaveDone, CreateFourthWaveDone);
    }
    private void OnDestroy()
    {
        EventCenter.Ins.Remove((int)KTGMGemClient.EventType.AddCard, AddCard);
        EventCenter.Ins.Remove((int)KTGMGemClient.EventType.CreateFireLv2, CreateFireLv2);
        EventCenter.Ins.Remove((int)KTGMGemClient.EventType.ChargingEnd, ChargingEnd);
        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.SkillReleaseDone, SkillReleaseDone);
        EventCenter.Ins.Remove((int)KTGMGemClient.EventType.CreateWoodLv2, CreateWoodLv2);
        EventCenter.Ins.Remove((int)KTGMGemClient.EventType.KillDone, KillDone);
        EventCenter.Ins.Remove((int)KTGMGemClient.EventType.CreateFireLv1, CreateFireLv1);
        EventCenter.Ins.Remove((int)KTGMGemClient.EventType.CreateWaterLv1, CreateWaterLv1);
        EventCenter.Ins.Remove((int)KTGMGemClient.EventType.DragStep, DragStep);
    }
    public void Init(int step)
    {
        //Time.timeScale = 0;//游戏暂停,这样会导致协程停止了
        ChangeStep(GuideEnum.Step0);
        ChangeStep(GuideEnum.Step1);
        GameConfig.CanOpenNewTower = false;
        // switch (step)
        // {
        //     case 2:
        //     case 3:
        //         //生成两个火元素
        //         break;
        //     case 4:
        //         //生成1个2级火元素,标记上阵位置
        //         break;
        //     case 5:
        //         //生成2级火元素塔,第一关小怪出木元素小怪
        //         break;
        // }
        // ChangeStep((GuideEnum)(step + 1));
    }
@@ -90,22 +76,34 @@
    void AddDic()
    {
        allGuideDic = new Dictionary<GuideEnum, string[]>();
        allGuideDic.Add(GuideEnum.Step0, new string[] { GuideConfig.showWords[0], GuideConfig.showWords[1] });
        allGuideDic.Add(GuideEnum.Step1, new string[] { GuideConfig.showWords[2], GuideConfig.showWords[3] });
        allGuideDic.Add(GuideEnum.Step2, new string[] { GuideConfig.showWords[4], GuideConfig.showWords[5] });
        allGuideDic.Add(GuideEnum.Step3, new string[] { GuideConfig.showWords[6], GuideConfig.showWords[7] });
        allGuideDic.Add(GuideEnum.Step4, new string[] { GuideConfig.showWords[8] });
        allGuideDic.Add(GuideEnum.Step5, new string[] { GuideConfig.showWords[9], GuideConfig.showWords[10] });
        allGuideDic.Add(GuideEnum.Step6, new string[] { GuideConfig.showWords[11], GuideConfig.showWords[12] });
        allGuideDic.Add(GuideEnum.Step7, new string[] { GuideConfig.showWords[13] });
        allGuideDic.Add(GuideEnum.Step8, new string[] { GuideConfig.showWords[14], GuideConfig.showWords[15] });
        allGuideDic.Add(GuideEnum.Step9, new string[] { GuideConfig.showWords[16], GuideConfig.showWords[17] });
        allGuideDic.Add(GuideEnum.Step10, new string[] { GuideConfig.showWords[18], GuideConfig.showWords[19] });
        allGuideDic.Add(GuideEnum.Step11, new string[] { GuideConfig.showWords[20], GuideConfig.showWords[21] });
        allGuideDic.Add(GuideEnum.Step12, new string[] { GuideConfig.showWords[22], GuideConfig.showWords[23], GuideConfig.showWords[24] });
        allGuideDic.Add(GuideEnum.Step1, new string[] {
           "对面的怪物要发动攻击了,训练师大人,请做好防御准备",
           "我给您准备了一份宝箱大礼,打开试试"});
        allGuideDic.Add(GuideEnum.Step2, new string[] { "点击按钮购买宝石", "再购买一个" });
        allGuideDic.Add(GuideEnum.Step3, new string[] {
            "玉米枪手单体输出高,能有效克制$单位",// $ 慢速肉盾
            "看到走路慢吞吞的怪,就用玉米枪手对付它吧!" ,
                        "接下来该换我亲自上阵了"});
        allGuideDic.Add(GuideEnum.Step4, new string[] { "点击按钮购买宝石" });
        allGuideDic.Add(GuideEnum.Step5, new string[] {
            "对付%敌人,我的`是最合适的", // % 大量    ` 群攻炸弹
            "请交换我和玉米枪手的位置!以后也可以随时交换哦" ,
        "最后的伙伴已经达到战场,看看它是谁吧"});
        allGuideDic.Add(GuideEnum.Step6, new string[] { "点击按钮购买宝石" });
        allGuideDic.Add(GuideEnum.Step7, new string[] {
            "不好,敌人太多了",
        "试着用技能秒杀全部敌人吧!",
        "对付不同敌人,用&效果更好,请继续战斗吧,训练师"// & 特定的精灵
         });
    }
    /// <summary>
    /// 引导步骤
@@ -113,55 +111,33 @@
    /// <param name="step"></param>
    public void ChangeStep(GuideEnum step)
    {
        //if (currentStep != step)
        currentStep = step;
        switch (currentStep)
        {
            currentStep = step;
            switch (currentStep)
            {
                case GuideEnum.Step0:
                    Step0();
                    break;
                case GuideEnum.Step1:
                    Step1();
                    break;
                case GuideEnum.Step2:
                    Step2();
                    break;
                case GuideEnum.Step3:
                    Step3();
                    break;
                case GuideEnum.Step4:
                    Step4();
                    break;
                case GuideEnum.Step5:
                    Step5();
                    break;
                case GuideEnum.Step6:
                    Step6();
                    break;
                case GuideEnum.Step7:
                    Step7();
                    break;
                case GuideEnum.Step8:
                    Step8();
                    break;
                case GuideEnum.Step9:
                    Step9();
                    break;
                case GuideEnum.Step10:
                    Step10();
                    break;
                case GuideEnum.Step11:
                    Step11();
                    break;
                case GuideEnum.Step12:
                    Step12();
                    break;
                case GuideEnum.Finish:
                    Finish();
                    break;
            }
            case GuideEnum.Step1:
                Step1();
                break;
            case GuideEnum.Step2:
                Step2();
                break;
            case GuideEnum.Step3:
                Step3();
                break;
            case GuideEnum.Step4:
                Step4();
                break;
            case GuideEnum.Step5:
                Step5();
                break;
            case GuideEnum.Step6:
                Step6();
                break;
            case GuideEnum.Step7:
                Step7();
                break;
            case GuideEnum.Finish:
                Finish();
                break;
        }
    }
@@ -169,425 +145,280 @@
    #region 步骤分解
    private void Step0()
    {
        isShowing = true;
        if (currentIndex == -1)//初始化本步
        {
            CommonDebugHelper.DebugError("第1步开始");
            GA_SDK_Manager.Ins.Statistics(5);//埋点
            currentIndex = 0;
            needIndex = 2;
            panel.SetGuideUI(true);
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
        }
        else if (currentIndex == 1)
        {
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
        }
    }
    //步骤1 :对话---开箱---玉米
    private void Step1()
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第2步开始");
            GA_SDK_Manager.Ins.Statistics(6);//埋点
            GA_SDK_Manager.Ins.GuideStep(1);//埋点
            currentIndex = 0;
            needIndex = 2;
            panel.SetGuideUI(false);
            panel.Step1(allGuideDic[currentStep][currentIndex], currentIndex, Step1_1);
        }
        else if (currentIndex == 1)
        {
            panel.Step1(allGuideDic[currentStep][currentIndex], currentIndex, Step1_2);
            currentIndex++;
        }
        CommonDebugHelper.DebugError("步骤1 :对话---开箱---玉米");
        panel.Step1(allGuideDic[currentStep], Step1Finish);
    }
    /// <summary>
    /// 分步1,购买1排1列的火元素
    /// </summary>
    private void Step1_1()
    private void Step1Finish()
    {
        panel.Step1_1();
        OnFinishOneStep();
    }
    /// <summary>
    /// 分步2,购买2排3列的火元素
    /// </summary>
    private void Step1_2()
    {
        panel.Step1_2();
        StartCoroutine(AfterCreateFire());
        Debug.Log("玉米组件展示结束,打点");
        TDAA_SDKManager.Ins.GuideStep(1);//埋点
        TDAA_SDKManager.Ins.Statistics(6);//埋点
        ChangeStep(GuideEnum.Step2);
    }
    IEnumerator AfterCreateFire()
    {
        yield return new WaitForSeconds(1f);
        OnFinishOneStep();
    }
    //对话
    //步骤2:购买---购买---合成---上阵
    private void Step2()
    {
        isShowing = true;
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第3步开始");
            GA_SDK_Manager.Ins.GuideStep(2);//埋点
            currentIndex = 0;
            needIndex = 2;
            panel.Step2(currentIndex);
            panel.SetGuideUI(true);
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
            //隐藏
        }
        else if (currentIndex == 1)
        {
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
            //currentIndex++;
        }
    }
    //引导合成
    private void Step3()
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第4步开始");
            GA_SDK_Manager.Ins.GuideStep(3);//埋点
            currentIndex = 0;
            needIndex = 2;
            panel.Step3(currentIndex, allGuideDic[currentStep][currentIndex]);
        }
        CommonDebugHelper.DebugError("步骤2:购买---购买---合成---上阵");
        panel.Step2(allGuideDic[currentStep]);
    }
    //开始拖拽
    public void BeginDrag()
    {
        panel.Step3_2(allGuideDic[currentStep][1]);
        panel.RimWood1();
    }
    //结束推拽 没有合成,回到上一步
    public void EndDrag()
    {
        panel.Step3(0, allGuideDic[currentStep][0]);
        panel.RimWood2();
    }
    //合成了卡牌,开始下一步
    private void AddCard()
    //合成了2级木 准备引导上阵
    public void AddCard()
    {
        currentIndex = -1;
        ChangeStep(GuideEnum.Step4);
        panel.AddCard();
    }
    private void Step4()
    /// <summary>
    /// 上阵一个二级木元素
    /// </summary>
    private void CreateWoodLv2()
    {
        if (currentIndex == -1)
        panel.OnWoodAttackPos();
        ChangeStep(GuideEnum.Step3);
    }
    /// <summary>
    ///  步骤3 :对话---出兵后杀光---对话---展示火鸡
    /// </summary>
    /// <param name="str"></param>
    /// <param name="cb"></param>
    public void Step3()
    {
        CommonDebugHelper.DebugError("步骤3 :对话---出兵后杀光---对话---展示火鸡");
        Debug.Log("玉米上阵了,打点");
        TDAA_SDKManager.Ins.GuideStep(2);//埋点
        string[] s1 = new string[] { allGuideDic[currentStep][0], allGuideDic[currentStep][1] };
        panel.Step3(s1, AfterTalk);
    }
    /// <summary>
    /// 对话结束,出兵
    /// </summary>
    private void AfterTalk()
    {
        panel.Step3AfterTalk();
        EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.CreateFirstWave);
    }
    /// <summary>
    /// 第一关怪物被杀光
    /// </summary>
    private void KillDone()
    {
        string[] s2 = new string[] { allGuideDic[currentStep][2] };
        panel.CloseSkillImage();
        panel.Step3(s2, OpenBoxFire);
    }
    /// <summary>
    /// 展示火鸡
    /// </summary>
    private void OpenBoxFire()
    {
        panel.Step3_3(() =>
        {
            CommonDebugHelper.DebugError("第5步开始");
            GA_SDK_Manager.Ins.GuideStep(4);//埋点
            currentIndex = 0;
            panel.Step4(currentIndex, allGuideDic[currentStep][currentIndex]);
        }
            ChangeStep(GuideEnum.Step4);
        });
    }
    //建造了塔,开始下一步
    private void CreateFireLv2()
    /// <summary>
    ///  步骤4 :点击购买---上阵
    /// </summary>
    /// <param name="str"></param>
    /// <param name="cb"></param>
    public void Step4()
    {
        currentIndex = -1;
        Debug.Log("火鸡组件展示完毕,打点");
        TDAA_SDKManager.Ins.GuideStep(3);//埋点
        panel.Step4(allGuideDic[currentStep]);
    }
    private void CreateFireLv1()
    {
        panel.OnFireAttackPos();
        ChangeStep(GuideEnum.Step5);
    }
    private void Step5()
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第6步开始");
            GA_SDK_Manager.Ins.GuideStep(5);//埋点
            EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.CreateFirstWave);
            panel.Step5(currentIndex, "");
        }
        else if (currentIndex == 1)
        {
            isShowing = true;
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
        }
    }
    private void ChargingEnd()
    {
        currentIndex = 0;
        needIndex = 2;
        panel.SetGuideUI(true);
        isShowing = true;
        panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
    }
    private void Step6()
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第7步开始");
            GA_SDK_Manager.Ins.GuideStep(6);//埋点
            panel.SetGuideUI(false);
            //恢复出怪
            EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.RestartWave);
        }
        else if (currentIndex == 1)
        {
            isShowing = true;
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
            //增加200金币
            EventCenter.Ins.BroadCast<int>((int)KTGMGemClient.EventType.AddGold, 200);
        }
    }
    private void KillDone()
    {
        currentIndex = 0;
        needIndex = 2;
        panel.SetGuideUI(true);
        isShowing = true;
        panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
    }
    private void Step7()
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第8步开始");
            GA_SDK_Manager.Ins.GuideStep(7);//埋点
            currentIndex = 0;
            needIndex = 1;
            panel.SetGuideUI(false);
            GameConfig.CanOpenNewTower = true;
            //等待解锁塔
            panel.Step7(currentIndex, allGuideDic[currentStep][currentIndex]);
        }
    }
    private void GetOneTowerPos()
    {
        currentIndex = -1;
        ChangeStep(GuideEnum.Step8);
    }
    private void Step8()
    {
        isShowing = true;
        if (currentIndex == -1)//初始化本步
        {
            CommonDebugHelper.DebugError("第9步开始");
            GA_SDK_Manager.Ins.GuideStep(8);//埋点
            GameConfig.CanOpenNewTower = false;
            currentIndex = 0;
            needIndex = 2;
            panel.Step8();
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
        }
        else if (currentIndex == 1)
        {
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
        }
    }
    private void Step9()
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第10步开始");
            GA_SDK_Manager.Ins.GuideStep(9);//埋点
            currentIndex = 0;
            needIndex = 2;
            panel.SetGuideUI(false);
            panel.Step9(allGuideDic[currentStep][currentIndex], currentIndex, Step9_1);
        }
        else if (currentIndex == 1)
        {
            panel.Step9(allGuideDic[currentStep][currentIndex], currentIndex, null);
        }
    }
    /// <summary>
    /// 分步9,购买1排5列的水元素
    ///  步骤5:第二关出兵---三波后---对话框---置换2&3---杀光敌人---对话框---展示water
    /// </summary>
    private void Step9_1()
    /// <param name="str"></param>
    /// <param name="cb"></param>
    public void Step5()
    {
        panel.Step9_1();
        OnFinishOneStep();
        Debug.Log("火鸡上阵了,打点");
        //第二关出兵
        TDAA_SDKManager.Ins.GuideStep(4);//埋点
        //panel.Step5()
        EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.CreateSecondWave);
    }
    private void CreateWaterLv1()
    private void DragStep()
    {
        panel.CleanMask();
        EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.CreateSecondWave);//生成第二波小怪
    }
        string[] s2 = new string[] { allGuideDic[currentStep][0], allGuideDic[currentStep][1] };
    private void SkillStep()
    {
        currentIndex = -1;
        ChangeStep(GuideEnum.Step10);
    }
    private void Step10()
    {
        isShowing = true;
        if (currentIndex == -1)//初始化本步
        {
            CommonDebugHelper.DebugError("第11步开始");
            GA_SDK_Manager.Ins.GuideStep(10);//埋点
            currentIndex = 0;
            needIndex = 2;
            panel.SetGuideUI(true);
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
        }
        else if (currentIndex == 1)
        {
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
            panel.Step10();
        }
    }
    private void Step11()
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第12步开始");
            GA_SDK_Manager.Ins.GuideStep(11);//埋点
            currentIndex = 0;
            needIndex = 1;
            panel.Step11(currentIndex, allGuideDic[currentStep][currentIndex]);
        }
        panel.Step5(s2);
    }
    //开始拖拽
    public void BeginDrag11_1()
    public void BeginDrag5_1()
    {
        panel.Step11(1, allGuideDic[currentStep][1]);
        panel.Step5Drag(1);
    }
    //结束推拽 没有合成,回到上一步
    public void EndDrag11_1()
    public void EndDrag5_1()
    {
        panel.Step11(0, allGuideDic[currentStep][0]);
        panel.Step5Drag(0);
    }
    private void SkillReleaseDone()
    public void DragDone()
    {
        currentIndex = -1;
        ChangeStep(GuideEnum.Step12);
        GameConfig.CanDragTower = false;
        CommonDebugHelper.Debug("结束拖拽");
        panel.Step5Drag(2);
        EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.RestartWave);
        //ChangeStep(GuideEnum.Step6);
    }
    private void Step12()
    private void KillSecondDone()
    {
        isShowing = true;
        if (currentIndex == -1)//初始化本步
        string[] s2 = new string[] { allGuideDic[currentStep][2] };
        panel.Step5Talk(s2, OpenBoxWater);
    }
    /// <summary>
    /// 展示水
    /// </summary>
    private void OpenBoxWater()
    {
        panel.Step5_7(() =>
        {
            CommonDebugHelper.DebugError("第13步开始");
            GA_SDK_Manager.Ins.GuideStep(12);//埋点
            currentIndex = 0;
            needIndex = 3;
            panel.Step12();
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
        }
        else
        {
            panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack);
        }
            ChangeStep(GuideEnum.Step6);
        });
    }
    /// <summary>
    ///  步骤6:购买---上阵---第三关---杀光
    /// </summary>
    /// <param name="str"></param>
    /// <param name="cb"></param>
    public void Step6()
    {
        Debug.Log("展示雪糕完毕,打点");
        TDAA_SDKManager.Ins.GuideStep(5);//埋点
        panel.Step6(allGuideDic[currentStep]);
    }
    /// <summary>
    /// 水元素上阵了
    /// </summary>
    private void CreateWaterLv1()
    {
        panel.OnWaterAttackPos();
        EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.CreateThirdWave);//开始第三关
    }
    private void KillThirdDone()
    {
        ChangeStep(GuideEnum.Step7);
    }
    /// <summary>
    ///  步骤6:
    /// </summary>
    /// <param name="str"></param>
    /// <param name="cb"></param>
    public void Step7()
    {
        Debug.Log("第三关杀完怪了,打点");
        TDAA_SDKManager.Ins.GuideStep(6);//埋点
                                         //一大波
        panel.Step7();
    }
    private void CreateFourthWaveDone()
    {
        string[] s1 = new string[] { allGuideDic[currentStep][0], allGuideDic[currentStep][1] };
        //对话后准备引导
        panel.Step7Talk(s1, Step7AfterTalk);
    }
    private void Step7AfterTalk()
    {
        string[] s2 = new string[] { allGuideDic[currentStep][2] };
        panel.SkillRelease(s2, Finish);
    }
    private void Finish()
    {
        UnityEngine.Debug.Log("新手指导已经完成了");
        GA_SDK_Manager.Ins.GuideStep(13);//埋点
        Debug.Log("完成新手引导,打点");
        TDAA_SDKManager.Ins.GuideStep(7);//埋点
        GameConfig.CanOpenNewTower = true;
        GameConfig.CanBuyNewTower = true;
        panel.FinishGuide();
        EndlessRandomTower.instance.SetCountDown(false, true);
        EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.GuideFinish);
        PlayerPrefs.SetInt("GemBattleGuide", 1);
        Destroy(gameObject);
        //gameObject.SetActive(false);
    }
    #endregion
    #region 点击事件
    bool isShowing;//是否正在显示文字
    /// <summary>
    /// 文字显示结束
    /// </summary>
    public void ShowWordCallBack()
    {
        isShowing = false;
        if (needIndex - currentIndex == 1)
        {
            currentIndex = needIndex;
        }
        //currentIndex++;
    }
    /// <summary>
    /// 完成了当前步骤中的一个分步骤
    /// </summary>
    public void OnFinishOneStep()
    {
        if (isShowing)
        {
            //正在显示文字,第一次点击,显示全部
            panel.ShowWordImmediately();
        }
        else if (needIndex - currentIndex > 0)
        {
            //说明当前步骤没完成,进行下一个分步
            currentIndex++;
            ChangeStep(currentStep);
        }
        else
        {
            //开始新的步骤
            currentIndex = -1;
            ChangeStep(currentStep + 1);
        }
        //Debug.LogError($"当前引导:{currentStep}  当前步数:{currentIndex}  总共有:{needIndex}步");
        // if (needIndex - currentIndex > 0)
        // {
        //     //说明当前步骤没完成,进行下一个分步
        //     currentIndex++;
        //     ChangeStep(currentStep);
        // }
        // else
        // {
        //     //开始新的步骤
        //     currentIndex = -1;
        //     ChangeStep(currentStep + 1);
        // }
    }
    #endregion