| | |
| | | Button skillBtn;// |
| | | Vector2 skillBtnPos = new Vector2(459, 280); |
| | | |
| | | private Image warningImg;//大波敌人来袭提示 |
| | | /// <summary> |
| | | /// 关闭所有UI |
| | | /// </summary> |
| | |
| | | |
| | | dragHandImg = transform.Find("ImageHand").GetComponent<RectTransform>(); |
| | | dragHandImg.gameObject.SetActive(false); |
| | | |
| | | warningImg = transform.Find("Image_Warning").GetComponent<Image>(); |
| | | warningImg.gameObject.SetActive(false); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 第九步, |
| | | /// 第九步,购买水元素,第二步上阵 |
| | | /// </summary> |
| | | /// <param name="str"></param> |
| | | /// <param name="currentIndex">当前第几步</param> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 第12步,引导释放技能 |
| | | /// 第12步,弃用 |
| | | /// </summary> |
| | | public void Step11(int currentIndex, string str) |
| | | { |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 第12步,引导释放技能 |
| | | /// 第12步,交换水火塔 |
| | | /// </summary> |
| | | public void Step11Drag(int currentIndex) |
| | | { |
| | |
| | | btnImg.raycastTarget = false; |
| | | |
| | | InitRectGuidance(btnImg, 75, 80, tmpOffect); |
| | | SetRimPos(towerPos2.gameObject); |
| | | StartCoroutine(ShowRimTip("拖动")); |
| | | //SetRimPos(towerPos2.gameObject); |
| | | SetRimPos(towerPos2.gameObject, new Vector2(0, 30)); |
| | | StartCoroutine(ShowRimTip("交换")); |
| | | ShowDragPath(towerPos2.GetComponent<RectTransform>().anchoredPosition, towerPos.GetComponent<RectTransform>()); |
| | | |
| | | } |
| | |
| | | btnImg.raycastTarget = false; |
| | | |
| | | InitRectGuidance(btnImg, 75, 80, tmpOffect); |
| | | SetRimPos(towerPos.gameObject); |
| | | StartCoroutine(ShowRimTip("拖动")); |
| | | //SetRimPos(towerPos.gameObject); |
| | | SetRimPos(towerPos.gameObject, new Vector2(0, 10)); |
| | | |
| | | StartCoroutine(ShowRimTip("交换")); |
| | | |
| | | } |
| | | else if (currentIndex == 2) |
| | |
| | | SetRimActive(false); |
| | | StopShowDragPath(true); |
| | | CloseMask(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 一大波敌人 |
| | | /// </summary> |
| | | public void Step11_End() |
| | | { |
| | | warningImg.color = new Color(1.0f, 1.0f, 1.0f, 0); |
| | | warningImg.gameObject.SetActive(true); |
| | | colorCount = 0; |
| | | SetWarningColor(); |
| | | } |
| | | |
| | | int colorCount = 0; |
| | | private void SetWarningColor() |
| | | { |
| | | if (colorCount < 4) |
| | | { |
| | | colorCount++; |
| | | warningImg.DOFade(colorCount % 2, 1.0f).OnComplete(SetWarningColor); |
| | | CommonDebugHelper.Debug($"执行了{colorCount}次"); |
| | | } |
| | | else |
| | | { |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.CreateThirdWave); |
| | | warningImg.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | |
| | | AddButtonListener(skillBtn.gameObject, ac); |
| | | Image btnImg = skillBtn.GetComponent<Image>(); |
| | | InitRectGuidance(btnImg, 79, 79f, Vector2.one); |
| | | SetRimPos(skillBtn.gameObject); |
| | | //SetRimPos(skillBtn.gameObject); |
| | | SetRimPos(skillBtn.gameObject, new Vector2(-15, 10)); |
| | | |
| | | text_Tip.text = str;//动态改变长度 |
| | | StartCoroutine(ShowRimTip(str)); |
| | | } |
| | |
| | | { |
| | | SetGuideUI(true); |
| | | backgroundImg.raycastTarget = true; |
| | | RemoveButtonListener(skillBtn.gameObject); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置边框的大小和位置 |
| | | /// </summary> |
| | | /// <param name="target"></param> |
| | | private void SetRimPos(GameObject target, Vector2 offect) |
| | | { |
| | | SetRimActive(true); |
| | | RectTransform rt = target.GetComponent<RectTransform>(); |
| | | if (target.gameObject.name == "TowerBuyBtn") |
| | | { |
| | | image_Rim_Rect.anchoredPosition = towerBuyBtnPos - tmpOffect; |
| | | } |
| | | else if (target.gameObject.name == "FireSkillBtn") |
| | | { |
| | | image_Rim_Rect.anchoredPosition = skillBtnPos - tmpOffect; |
| | | } |
| | | else |
| | | { |
| | | image_Rim_Rect.anchoredPosition = rt.anchoredPosition; |
| | | } |
| | | image_Rim_Rect.sizeDelta = (rt.sizeDelta * rt.localScale) + rimOffset; |
| | | if (image_Rim_Rect.sizeDelta.x > 200) |
| | | { |
| | | particle_1.SetActive(false); |
| | | particle_2.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | particle_1.SetActive(true); |
| | | particle_2.SetActive(false); |
| | | } |
| | | image_Tip_Rect.anchoredPosition = new Vector2(image_Rim_Rect.anchoredPosition.x, image_Rim_Rect.anchoredPosition.y + 74 / 2 + image_Rim_Rect.sizeDelta.y / 2); |
| | | image_Tip_Rect.anchoredPosition += offect; |
| | | } |
| | | |
| | | IEnumerator ShowRimTip(string str) |
| | | { |
| | | text_Tip.text = str;//动态改变长度 |