wangguan
2020-12-11 d4eadbf1bac0dba434d4c35e60e643143e770faa
Assets/Scripts/Guide/GuidePanelNew.cs
@@ -25,7 +25,7 @@
    Vector2 rimOffset = new Vector2(30, 30);//边框要比按钮大一些
    Vector2 towerBuyBtnPos;//动态生成按钮抠图位置
    Vector2 skillBtnPos = new Vector2(459, 44.6f);
    Vector2 skillBtnPos = new Vector2(459, 121f);
    private Image warningImg;//大波敌人来袭提示
@@ -39,7 +39,9 @@
    ImageTowerPos towerPos3;//塔位标识
    Image tmpMask;//自身的阻挡射线Panel
    ParticleSystem finishPS;
    //ParticleSystem finishPS;
    Button finishBtn;
    Image finishImg;
    void Awake()
    {
        tmpMask = transform.GetComponent<Image>();
@@ -139,7 +141,13 @@
        skillBtn = GameObject.Find("UICamera/BottomCanvas/Panel/Energy/FireSkillBg/SkillBtn").GetComponent<Button>();
        skillBtn.interactable = false;
        finishPS = transform.Find("Effect_UI_YinDaoJieShu/Particle System (3)").GetComponent<ParticleSystem>();
        finishBtn = transform.Find("FinishImageBtn").GetComponent<Button>();
        finishImg = finishBtn.transform.Find("FinishImage").GetComponent<Image>();
        finishImg.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
        finishBtn.onClick.AddListener(OnClickFinish);
        finishBtn.gameObject.SetActive(false);
        //finishPS = transform.Find("Effect_UI_YinDaoJieShu/Particle System (3)").GetComponent<ParticleSystem>();
        towerBuyBtn.gameObject.SetActive(false);
    }
@@ -186,6 +194,8 @@
    {
        //关闭对话框
        SetGuideUI(false);
        towerBuyBtn.gameObject.SetActive(true);
        //开箱
        boxPanel.ChangeType(GuideBoxType.Wood, Step1Finish);
    }
@@ -217,6 +227,7 @@
    {
        strArray = str;
        tmpMask.enabled = false;
        AddButtonListener(towerBuyBtn, Step2_1);
        Image btnImg = towerBuyBtn.GetComponent<Image>();
        InitRectGuidance(btnImg, 159, 73.5f, Vector2.one);
@@ -230,7 +241,6 @@
    private void Step2_1()
    {
        Wood1Appear();
    }
    private void Wood1Appear()
@@ -254,6 +264,9 @@
    private void Step2_2()
    {
        Wood2Appear();
        //StartCoroutine(ShowRimTip(strArray[2]));
    }
@@ -266,6 +279,8 @@
            wood2PS2.Play();
            //fire2.enabled = false;
            DestoryButtonListener(towerBuyBtn);
            towerBuyBtn.gameObject.SetActive(false);
            SetRimActive(false);
            CloseGuidance();
            tmpMask.enabled = true;
@@ -353,6 +368,8 @@
    {
        //关闭对话框
        SetGuideUI(false);
        towerBuyBtn.gameObject.SetActive(true);
        //开箱
        boxPanel.ChangeType(GuideBoxType.Fire, cb);
    }
@@ -372,7 +389,6 @@
        InitRectGuidance(btnImg, 159, 73.5f, Vector2.one);
        SetRimPos(towerBuyBtn);
        StartCoroutine(ShowRimTip(strArray[0]));
    }
    /// <summary>
@@ -393,6 +409,8 @@
            firePS1.Play();
            firePS1.Play();
            RemoveButtonListener(towerBuyBtn);
            towerBuyBtn.gameObject.SetActive(false);
            Step4_2();
        }
    }
@@ -501,6 +519,8 @@
    {
        //关闭对话框
        SetGuideUI(false);
        towerBuyBtn.gameObject.SetActive(true);
        //开箱
        boxPanel.ChangeType(GuideBoxType.Water, cb);
    }
@@ -528,7 +548,6 @@
    private void Step6_1()
    {
        WaterAppear();
    }
    private void WaterAppear()
@@ -541,6 +560,8 @@
            waterPS1.Play();
            waterPS2.Play();
            RemoveButtonListener(towerBuyBtn);
            towerBuyBtn.gameObject.SetActive(false);
            Step6_2();
        }
    }
@@ -632,13 +653,26 @@
        CloseGuidance();
        SetGuideUI(true);
        //StartShowWord(str, ac);
        callBack = ac;
        StartShowWord(str, ShowFinishPanel);
        // charForeach.StartFinalShowWord(str, ac, () =>
        // {
        //     finishPS.Play();
        // });
        charForeach.StartFinalShowWord(str, ac, () =>
        {
            finishPS.Play();
        });
    }
    private void ShowFinishPanel()
    {
        SetGuideUI(false);
        //显示引导结束面板,再次点击按钮关闭
        finishBtn.gameObject.SetActive(true);
        finishImg.transform.DOScale(Vector3.one, 0.5f);
    }
    private void OnClickFinish()
    {
        callBack?.Invoke();
    }