| | |
| | | void Awake() |
| | | { |
| | | tmpMask = GetComponent<Image>(); |
| | | tmpMask.enabled = false; |
| | | backgroundImg = transform.Find("Button").GetComponent<Image>(); |
| | | backgroundImg.color = new Color(1.0f, 1.0f, 1.0f, 0); |
| | | |
| | | towerBuyBtn = GameObject.Find("MainUI/TowerBuyBtn"); |
| | | tipsUI = transform.Find("Tips").gameObject; |
| | | tipsUI.transform.SetAsLastSibling();//把tips放在最下面 |
| | |
| | | /// <param name="active"></param> |
| | | public void SetGuideUI(bool active) |
| | | { |
| | | if (backgroundImg.raycastTarget != active) backgroundImg.raycastTarget = active; |
| | | tipsUI.SetActive(active); |
| | | if (backgroundImg.enabled != active) |
| | | backgroundImg.enabled = active; |
| | | if (tipsUI.activeSelf != active) |
| | | tipsUI.SetActive(active); |
| | | } |
| | | |
| | | //开始打印文字 |
| | |
| | | SetRimActive(true); |
| | | AddButtonListener(towerBuyBtn, ac); |
| | | Image btnImg = towerBuyBtn.GetComponent<Image>(); |
| | | InitRectGuidance(btnImg); |
| | | InitRectGuidance(btnImg, 189, 73.5f); |
| | | SetRimPos(towerBuyBtn); |
| | | maskObj.ShowImmediately(); |
| | | |
| | |
| | | { |
| | | fire2.gameObject.SetActive(true); |
| | | fire2.enabled = false; |
| | | DestoryButtonListener(towerBuyBtn); |
| | | //RemoveButtonListener(towerBuyBtn); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public void Step2(int currentIndex) |
| | | { |
| | | backgroundImg.raycastTarget = true; |
| | | |
| | | RemoveButtonListener(towerBuyBtn); |
| | | |
| | | //RemoveButtonListener(towerBuyBtn); |
| | | SetRimActive(false); |
| | | CloseMask(); |
| | | } |
| | |
| | | { |
| | | if (currentIndex == 0) |
| | | { |
| | | backgroundImg.raycastTarget = false; |
| | | backgroundImg.color = new Color(1.0f, 1.0f, 1.0f, 1.0f); |
| | | tmpMask.enabled = true; |
| | | |
| | | SetGuideUI(false); |
| | | |
| | | SetRimPos(fire2.gameObject); |
| | |
| | | { |
| | | if (currentIndex == 0) |
| | | { |
| | | tmpMask.enabled = false; |
| | | |
| | | SetRimActive(true); |
| | | Image btnImg = transform.Find("Image_TowerPos").GetComponent<Image>(); |
| | | towerPos.enabled = true; |
| | | InitRectGuidance(btnImg); |
| | | InitRectGuidance(btnImg, 75, 80); |
| | | SetRimPos(btnImg.gameObject); |
| | | maskObj.ShowImmediately(); |
| | | StartCoroutine(ShowRimTip(str)); |
| | |
| | | { |
| | | CloseMask(); |
| | | SetRimActive(false); |
| | | backgroundImg.color = new Color(1.0f, 1.0f, 1.0f, 0); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | GameObject go = transform.Find("Image_TowerPos2").gameObject; |
| | | |
| | | Image btnImg = go.GetComponent<Image>(); |
| | | InitRectGuidance(btnImg); |
| | | btnImg.raycastTarget=false; |
| | | InitRectGuidance(btnImg, 75, 80); |
| | | SetRimPos(go); |
| | | maskObj.ShowImmediately(); |
| | | StartCoroutine(ShowRimTip(str)); |
| | |
| | | //介绍水元素 |
| | | public void Step8() |
| | | { |
| | | backgroundImg.color = new Color(1.0f, 1.0f, 1.0f, 0); |
| | | SetGuideUI(true); |
| | | SetRimActive(false); |
| | | CloseMask(); |
| | |
| | | { |
| | | if (currentIndex == 0) |
| | | { |
| | | |
| | | SetRimActive(true); |
| | | //设置位置 |
| | | AddButtonListener(towerBuyBtn, ac); |
| | | |
| | | Image btnImg = towerBuyBtn.GetComponent<Image>(); |
| | | InitRectGuidance(btnImg); |
| | | InitRectGuidance(btnImg, 189, 73.5f); |
| | | SetRimPos(towerBuyBtn); |
| | | maskObj.ShowImmediately(); |
| | | } |
| | |
| | | { |
| | | GameObject go = transform.Find("Image_TowerPos2").gameObject; |
| | | Image btnImg = go.GetComponent<Image>(); |
| | | InitRectGuidance(btnImg); |
| | | btnImg.raycastTarget=true; |
| | | InitRectGuidance(btnImg, 75, 80); |
| | | SetRimPos(go); |
| | | maskObj.ShowImmediately(); |
| | | } |
| | |
| | | |
| | | public void Step9_1() |
| | | { |
| | | RemoveButtonListener(towerBuyBtn); |
| | | water1.gameObject.SetActive(true); |
| | | towerPos2.enabled = true; |
| | | DestoryButtonListener(towerBuyBtn); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | if (currentIndex == 0) |
| | | { |
| | | tmpMask.enabled = true; |
| | | |
| | | SetGuideUI(false); |
| | | SetRimActive(true); |
| | | SetRimPos(skill.gameObject); |
| | |
| | | public void Step12() |
| | | { |
| | | image_SkillRim.gameObject.SetActive(false); |
| | | tmpMask.enabled = false; |
| | | |
| | | SetGuideUI(true); |
| | | SetRimActive(false); |
| | |
| | | /// 抠出来一个区域 |
| | | /// </summary> |
| | | /// <param name="target"></param> |
| | | void InitRectGuidance(Image target) |
| | | void InitRectGuidance(Image target, float x, float y) |
| | | { |
| | | if (!maskObj.gameObject.activeSelf) |
| | | { |
| | | maskObj.gameObject.SetActive(true); |
| | | } |
| | | maskObj.Init(target); |
| | | //maskObj.Init(target); |
| | | maskObj.InitForCamera(target, x, y); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | eventTriggerListener.RemoveListener(go); |
| | | } |
| | | |
| | | private void DestoryButtonListener(GameObject go) |
| | | { |
| | | EventTriggerListener eventTriggerListener = EventTriggerListener.GetListener(go); |
| | | |
| | | if (eventTriggerListener != null) |
| | | Destroy(eventTriggerListener); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |