From a27b3510185c04eb385f5ab3ad24fd4e87a27626 Mon Sep 17 00:00:00 2001 From: wangguan <wangguan@kt007.com> Date: Tue, 24 Nov 2020 20:58:51 +0800 Subject: [PATCH] 修改新手引导,没有测试适配 --- Assets/Scripts/Guide/GuidePanel.cs | 95 +++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 83 insertions(+), 12 deletions(-) diff --git a/Assets/Scripts/Guide/GuidePanel.cs b/Assets/Scripts/Guide/GuidePanel.cs index 1a2f525..135968a 100644 --- a/Assets/Scripts/Guide/GuidePanel.cs +++ b/Assets/Scripts/Guide/GuidePanel.cs @@ -45,6 +45,10 @@ Image backgroundImg;//用来接受空白点击事件的图片 RectTransform dragHandImg;//拖动标识手指 + + Button skillBtn;// + Vector2 skillBtnPos = new Vector2(459, 280); + /// <summary> /// 关闭所有UI /// </summary> @@ -66,6 +70,8 @@ backgroundImg = transform.Find("Button").GetComponent<Image>(); + skillBtn = GameObject.Find("UICamera/BottomCanvas/Panel/Energy/FireSkillBtn").GetComponent<Button>(); + skillBtn.interactable = false; towerBuyBtn = GameObject.Find("UICamera/BottomCanvas/Panel/TowerBuyBtn"); RectTransform tmpTs = towerBuyBtn.GetComponent<RectTransform>(); @@ -193,7 +199,6 @@ /// <param name="currentIndex">当前第几步</param> public void Step1(string str, int currentIndex, Action ac) { - if (currentIndex == 0) { backgroundImg.raycastTarget = false; @@ -212,7 +217,6 @@ } text_Tip.text = str;//动态改变长度 StartCoroutine(ShowRimTip(str)); - } public void Step1_1() @@ -350,17 +354,13 @@ { if (currentIndex == 0) { - SetRimActive(true); - image_Tip_Rect.gameObject.SetActive(false); //设置位置 AddButtonListener(towerBuyBtn, ac); - Image btnImg = towerBuyBtn.GetComponent<Image>(); InitRectGuidance(btnImg, 159, 73.5f, Vector2.one); SetRimPos(towerBuyBtn); - //maskObj.ShowImmediately(); } else if (currentIndex == 1) { @@ -369,11 +369,8 @@ btnImg.raycastTarget = true; InitRectGuidance(btnImg, 75, 80, tmpOffect); SetRimPos(go); - //maskObj.ShowImmediately(); ShowDragPath(water1.GetStartP, btnImg.rectTransform); } - - //StartCoroutine(ShowRimTip(str)); } public void Step9_1() @@ -431,12 +428,79 @@ SetRimActive(false); } + + /// <summary> + /// 第12步,引导释放技能 + /// </summary> + public void Step11Drag(int currentIndex) + { + if (currentIndex == 0) + { + GameConfig.CanDragTower = true; + //标记水塔 引导拖动 + towerPos.GetComponent<Image>().raycastTarget = false; + towerPos2.GetComponent<Image>().raycastTarget = false; + backgroundImg.raycastTarget = false; + SetRimActive(true); + SetGuideUI(false); + Image btnImg = towerPos2.GetComponent<Image>(); + btnImg.raycastTarget = false; + + InitRectGuidance(btnImg, 75, 80, tmpOffect); + SetRimPos(towerPos2.gameObject); + StartCoroutine(ShowRimTip("拖动")); + ShowDragPath(towerPos2.GetComponent<RectTransform>().anchoredPosition, towerPos.GetComponent<RectTransform>()); + + } + else if (currentIndex == 1) + { + Image btnImg = towerPos.GetComponent<Image>(); + btnImg.raycastTarget = false; + + InitRectGuidance(btnImg, 75, 80, tmpOffect); + SetRimPos(towerPos.gameObject); + StartCoroutine(ShowRimTip("拖动")); + + } + else if (currentIndex == 2) + { + SetRimActive(false); + StopShowDragPath(true); + CloseMask(); + } + } + + public void Step12() { - - SetGuideUI(true); + backgroundImg.raycastTarget = true; } + + public void Step13(string str, Action ac) + { + skillBtn.interactable = true; + + EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.GuideEnergyUp, 100); + + SetGuideUI(false); + + backgroundImg.raycastTarget = false; + SetRimActive(true); + AddButtonListener(skillBtn.gameObject, ac); + Image btnImg = skillBtn.GetComponent<Image>(); + InitRectGuidance(btnImg, 79, 79f, Vector2.one); + SetRimPos(skillBtn.gameObject); + text_Tip.text = str;//动态改变长度 + StartCoroutine(ShowRimTip(str)); + } + + public void Step14() + { + SetGuideUI(true); + backgroundImg.raycastTarget = true; + } + #region 按钮以及提示 @@ -460,6 +524,10 @@ if (target.gameObject.name == "TowerBuyBtn") { image_Rim_Rect.anchoredPosition = towerBuyBtnPos - tmpOffect; + } + else if (target.gameObject.name == "FireSkillBtn") + { + image_Rim_Rect.anchoredPosition = skillBtnPos; } else { @@ -523,11 +591,14 @@ { maskObj.InitForCamera(target, towerBuyBtnPos, x, y); } + else if (target.gameObject.name == "FireSkillBtn") + { + maskObj.InitForCamera(target, skillBtnPos, x, y); + } else { maskObj.InitForCamera(target, x, y, offect); } - } /// <summary> -- Gitblit v1.9.1