River Jiang
2020-10-27 79e652bedf62f0842f59a2323f139f2e90efe819
Assets/Scripts/Guide/GuideCtrl.cs
@@ -32,7 +32,9 @@
    private void Start()
    {
        Init();
        //int step = PlayerPrefs.GetInt("GemBattleGuide");
        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);
@@ -57,11 +59,29 @@
    }
    public void Init()
    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));
    }
    /// <summary>
@@ -154,6 +174,7 @@
        isShowing = true;
        if (currentIndex == -1)//初始化本步
        {
            CommonDebugHelper.DebugError("第1步开始");
            currentIndex = 0;
            needIndex = 2;
            panel.SetGuideUI(true);
@@ -168,6 +189,8 @@
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第2步开始");
            currentIndex = 0;
            needIndex = 2;
            panel.SetGuideUI(false);
@@ -211,6 +234,7 @@
        isShowing = true;
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第3步开始");
            currentIndex = 0;
            needIndex = 2;
            panel.Step2(currentIndex);
@@ -230,6 +254,8 @@
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第4步开始");
            currentIndex = 0;
            needIndex = 2;
            panel.Step3(currentIndex, allGuideDic[currentStep][currentIndex]);
@@ -259,6 +285,8 @@
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第5步开始");
            currentIndex = 0;
            panel.Step4(currentIndex, allGuideDic[currentStep][currentIndex]);
        }
@@ -276,6 +304,8 @@
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第6步开始");
            EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.CreateFirstWave);
            panel.Step5(currentIndex, "");
        }
@@ -301,6 +331,8 @@
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第7步开始");
            panel.SetGuideUI(false);
            //恢复出怪
            EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.RestartWave);
@@ -330,9 +362,12 @@
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第8步开始");
            currentIndex = 0;
            needIndex = 1;
            panel.SetGuideUI(false);
            GameConfig.CanOpenNewTower = true;
            //等待解锁塔
            panel.Step7(currentIndex, allGuideDic[currentStep][currentIndex]);
@@ -353,6 +388,9 @@
        isShowing = true;
        if (currentIndex == -1)//初始化本步
        {
            CommonDebugHelper.DebugError("第9步开始");
            GameConfig.CanOpenNewTower = false;
            currentIndex = 0;
            needIndex = 2;
            panel.Step8();
@@ -370,6 +408,8 @@
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第10步开始");
            currentIndex = 0;
            needIndex = 2;
            panel.SetGuideUI(false);
@@ -407,6 +447,8 @@
        isShowing = true;
        if (currentIndex == -1)//初始化本步
        {
            CommonDebugHelper.DebugError("第11步开始");
            currentIndex = 0;
            needIndex = 2;
            panel.SetGuideUI(true);
@@ -424,6 +466,8 @@
    {
        if (currentIndex == -1)
        {
            CommonDebugHelper.DebugError("第12步开始");
            currentIndex = 0;
            needIndex = 1;
@@ -457,6 +501,8 @@
        isShowing = true;
        if (currentIndex == -1)//初始化本步
        {
            CommonDebugHelper.DebugError("第13步开始");
            currentIndex = 0;
            needIndex = 3;
            panel.Step12();
@@ -473,7 +519,11 @@
    private void Finish()
    {
        UnityEngine.Debug.Log("新手指导已经完成了");
        gameObject.SetActive(false);
        GameConfig.CanOpenNewTower = true;
        EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.GuideFinish);
        Destroy(gameObject);
        //gameObject.SetActive(false);
    }
    #endregion