private void CreateSoftEffectTip(RectTransform t, int id, SoftGuideView.StatusType status) { if (t == null) { return; } SoftGuideView[] views = t.GetComponentsInChildren <SoftGuideView>(true); if (views.Length == 0) { SoftGuideView view = SoftGuideView.Create(t, id, status); RectTransform rt = view.rectTransform; rt.sizeDelta = t.sizeDelta; Canvas canvas = view.GetComponentsInParent <Canvas>(true)[0]; rt.anchoredPosition3D = new Vector3(0, 0, canvas.planeDistance); Renderer[] orderChange = view.GetComponentsInChildren <Renderer>(true); Renderer particleRender; for (int i = 0, count = orderChange.Length; i < count; i++) { particleRender = orderChange[i]; particleRender.sortingLayerName = canvas.sortingLayerName; particleRender.sortingOrder += canvas.sortingOrder; } } else { for (int i = 0, count = views.Length; i < count; i++) { views[i].SetStatus(status); } } }
public void OnClickSoftGuideView(SoftGuideView view) { // Debug.Log(view.id + "," + view.status); SoftGuideInfo info = null; for (int i = 0, count = _currentGuideList.Count; i < count; i++) { if (_currentGuideList[i].id == view.id) { info = _currentGuideList[i]; break; } } if (info != null) { if (view.status == SoftGuideView.StatusType.FirstView) //一级界面 { if (!info.hasSecondView) { info.isTipOver = true; bool hasSame = CheckFirstSame(info); if (!hasSame) { RemoveSoftEffectTip(view.transform); } } } else if (view.status == SoftGuideView.StatusType.SecondView) //二级界面 { info.isTipOver = true; bool hasSame = CheckSecondSame(info); if (!hasSame) { RemoveSoftEffectTip(view.transform); } hasSame = CheckFirstSame(info); if (!hasSame) { GameObject firstView = UIMgr.instance.Get(info.firstViewPath); if (firstView != null) { RemoveSoftEffectTip(firstView.transform.Find(info.firstButtonPath)); } } } } }