wangguan
2020-12-15 194e5ffafca8d2ecaae2822c1c29f8565b68c4ae
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,6 +39,9 @@
    ImageTowerPos towerPos3;//塔位标识
    Image tmpMask;//自身的阻挡射线Panel
    //ParticleSystem finishPS;
    Button finishBtn;
    Image finishImg;
    void Awake()
    {
        tmpMask = transform.GetComponent<Image>();
@@ -137,6 +140,14 @@
        skillBtn = GameObject.Find("UICamera/BottomCanvas/Panel/Energy/FireSkillBg/SkillBtn").GetComponent<Button>();
        skillBtn.interactable = false;
        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);
    }
@@ -153,7 +164,13 @@
        //fire2.GetComponent<RectTransform>().anchoredPosition -= tmpOffect;
        towerPos.GetComponent<RectTransform>().anchoredPosition -= tmpOffect;
        towerPos2.GetComponent<RectTransform>().anchoredPosition -= tmpOffect;
        towerPos3.GetComponent<RectTransform>().anchoredPosition -= tmpOffect;
        wood1.GetComponent<RectTransform>().anchoredPosition -= tmpOffect;
        wood2.GetComponent<RectTransform>().anchoredPosition -= tmpOffect;
        fire.GetComponent<RectTransform>().anchoredPosition -= tmpOffect;
        water.GetComponent<RectTransform>().anchoredPosition -= tmpOffect;
        //fire.GetComponent<RectTransform>().anchoredPosition -= tmpOffect;
        //skill.GetComponent<RectTransform>().anchoredPosition -= tmpOffect;
    }
@@ -177,6 +194,8 @@
    {
        //关闭对话框
        SetGuideUI(false);
        towerBuyBtn.gameObject.SetActive(true);
        //开箱
        boxPanel.ChangeType(GuideBoxType.Wood, Step1Finish);
    }
@@ -208,6 +227,7 @@
    {
        strArray = str;
        tmpMask.enabled = false;
        AddButtonListener(towerBuyBtn, Step2_1);
        Image btnImg = towerBuyBtn.GetComponent<Image>();
        InitRectGuidance(btnImg, 159, 73.5f, Vector2.one);
@@ -221,9 +241,6 @@
    private void Step2_1()
    {
        Wood1Appear();
        RemoveButtonListener(towerBuyBtn);
        AddButtonListener(towerBuyBtn, Step2_2);
        StartCoroutine(ShowRimTip(strArray[1]));
    }
    private void Wood1Appear()
@@ -235,6 +252,9 @@
            wood1.enabled = false;
            wood1PS1.Play();
            wood1PS2.Play();
            RemoveButtonListener(towerBuyBtn);
            AddButtonListener(towerBuyBtn, Step2_2);
            StartCoroutine(ShowRimTip(strArray[1]));
        }
    }
@@ -245,26 +265,32 @@
    {
        Wood2Appear();
        offectBackground.SetActive(true);
        wood1.enabled = true;
        wood2.enabled = true;
        ShowDragPath(wood2.GetStartP, wood1.GetRect);
        RimWood2();
        image_Tip_Rect.gameObject.SetActive(false);
        //StartCoroutine(ShowRimTip(strArray[2]));
    }
    private void Wood2Appear()
    {
        wood2.gameObject.SetActive(true);
        wood2PS1.Play();
        wood2PS2.Play();
        //fire2.enabled = false;
        DestoryButtonListener(towerBuyBtn);
        SetRimActive(false);
        CloseGuidance();
        tmpMask.enabled = true;
        if (!wood2.gameObject.activeSelf)
        {
            wood2.gameObject.SetActive(true);
            wood2PS1.Play();
            wood2PS2.Play();
            //fire2.enabled = false;
            DestoryButtonListener(towerBuyBtn);
            towerBuyBtn.gameObject.SetActive(false);
            SetRimActive(false);
            CloseGuidance();
            tmpMask.enabled = true;
            offectBackground.SetActive(true);
            wood1.enabled = true;
            wood2.enabled = true;
            ShowDragPath(wood2.GetStartP, wood1.GetRect);
            RimWood2();
            image_Tip_Rect.gameObject.SetActive(false);
        }
    }
@@ -342,6 +368,8 @@
    {
        //关闭对话框
        SetGuideUI(false);
        towerBuyBtn.gameObject.SetActive(true);
        //开箱
        boxPanel.ChangeType(GuideBoxType.Fire, cb);
    }
@@ -361,7 +389,6 @@
        InitRectGuidance(btnImg, 159, 73.5f, Vector2.one);
        SetRimPos(towerBuyBtn);
        StartCoroutine(ShowRimTip(strArray[0]));
    }
    /// <summary>
@@ -370,8 +397,6 @@
    private void Step4_1()
    {
        FireAppear();
        RemoveButtonListener(towerBuyBtn);
        Step4_2();
    }
    private void FireAppear()
@@ -383,6 +408,10 @@
            fire.enabled = true;
            firePS1.Play();
            firePS1.Play();
            RemoveButtonListener(towerBuyBtn);
            towerBuyBtn.gameObject.SetActive(false);
            Step4_2();
        }
    }
@@ -467,6 +496,8 @@
        }
        else if (currentIndex == 2)
        {
            tmpMask.enabled = true;
            SetRimActive(false);
            StopShowDragPath(true);
            CloseGuidance();
@@ -488,6 +519,8 @@
    {
        //关闭对话框
        SetGuideUI(false);
        towerBuyBtn.gameObject.SetActive(true);
        //开箱
        boxPanel.ChangeType(GuideBoxType.Water, cb);
    }
@@ -515,8 +548,6 @@
    private void Step6_1()
    {
        WaterAppear();
        RemoveButtonListener(towerBuyBtn);
        Step6_2();
    }
    private void WaterAppear()
@@ -528,6 +559,10 @@
            water.enabled = true;
            waterPS1.Play();
            waterPS2.Play();
            RemoveButtonListener(towerBuyBtn);
            towerBuyBtn.gameObject.SetActive(false);
            Step6_2();
        }
    }
    /// <summary>
@@ -570,7 +605,6 @@
        {
            colorCount++;
            warningImg.DOFade(colorCount % 2, 1.0f).OnComplete(SetWarningColor);
            CommonDebugHelper.Debug($"执行了{colorCount}次");
        }
        else
        {
@@ -594,6 +628,7 @@
    /// </summary>
    public void GuideEnergyUp()
    {
        GameObject.Find("UICamera/MainUI/BloodUI").SetActive(false);
        EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.GuideEnergyUp, 100);
        tmpMask.enabled = false;
@@ -610,14 +645,36 @@
    public void SkillRelease(string[] str, Action ac)
    {
        GameObject.Find("UICamera/MainUI/BloodUI").SetActive(true);
        RemoveButtonListener(skillBtn.gameObject);
        SetRimActive(false);
        CloseGuidance();
        SetGuideUI(true);
        StartShowWord(str, ac);
        callBack = ac;
        StartShowWord(str, ShowFinishPanel);
        // 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();
    }
    public void FinishGuide()
    {
        towerBuyBtn.gameObject.SetActive(true);