public UIType(UIFormsType _UIFormsType, UIFormsShowType _UIFormsShowType, UIFormsLucencyType _UIFormsLucencyType, bool isClearStack) { this._UIFormsType = _UIFormsType; this._UIFormsShowType = _UIFormsShowType; this._UIFormsLucencyType = _UIFormsLucencyType; this.isClearStack = isClearStack; }
public void SetUIFormsMask(GameObject _UIForms, UIFormsLucencyType lucency) { _UIRoot.SetAsLastSibling(); _UIMaskPanel.SetAsLastSibling(); _UIForms.transform.SetAsLastSibling(); switch (lucency) { case UIFormsLucencyType.Lucency: _UIMaskImage.color = MyColorMgr.LUCENCY; ChangeUIMaskPanelStata(true); break; case UIFormsLucencyType.Translucent: _UIMaskImage.color = MyColorMgr.TRANSLUCENT; ChangeUIMaskPanelStata(true); break; case UIFormsLucencyType.LowTranslucent: _UIMaskImage.color = MyColorMgr.LOWTRANSLUCENT; ChangeUIMaskPanelStata(true); break; case UIFormsLucencyType.Transpaent: ChangeUIMaskPanelStata(false); break; default: break; } _UICamera.depth = _OriginCameraDpeth + 100; }
/// <summary> /// 设置遮罩状态 /// </summary> /// <param name="goDisplayPlane">需要显示的窗体</param> public void SetMaskWindow(GameObject goDisplayPlane, UIFormsLucencyType UILucencyType = UIFormsLucencyType.Lucency) { //顶层窗体下移。 _GoTopPlane.transform.SetAsLastSibling(); //启用遮罩窗体与透明度 switch (UILucencyType) { case UIFormsLucencyType.Lucency: _GoMaskPlane.SetActive(true); Color newColor1 = new Color(SysDefine.SYS_UIMASK_LUCENCY_COLOR_RGB, SysDefine.SYS_UIMASK_LUCENCY_COLOR_RGB, SysDefine.SYS_UIMASK_LUCENCY_COLOR_RGB, SysDefine.SYS_UIMASK_LUCENCY_COLOR_A); _GoMaskPlane.GetComponent <Image>().color = newColor1; break; case UIFormsLucencyType.Translucence: _GoMaskPlane.SetActive(true); Color newColor2 = new Color(SysDefine.SYS_UIMASK_TRANSLUCENCY_COLOR_RGB, SysDefine.SYS_UIMASK_TRANSLUCENCY_COLOR_RGB, SysDefine.SYS_UIMASK_TRANSLUCENCY_COLOR_RGB, SysDefine.SYS_UIMASK_TRANSLUCENCY_COLOR_A); _GoMaskPlane.GetComponent <Image>().color = newColor2; break; case UIFormsLucencyType.Impenetrable: _GoMaskPlane.SetActive(true); Color newColor3 = new Color(SysDefine.SYS_UIMASK_IMPENETRABLE_COLOR_RGB, SysDefine.SYS_UIMASK_IMPENETRABLE_COLOR_RGB, SysDefine.SYS_UIMASK_IMPENETRABLE_COLOR_RGB, SysDefine.SYS_UIMASK_IMPENETRABLE_COLOR_A); _GoMaskPlane.GetComponent <Image>().color = newColor3; break; case UIFormsLucencyType.Penetrate: if (_GoMaskPlane.activeInHierarchy) { _GoMaskPlane.SetActive(false); } break; default: break; } //遮罩窗体下移 _GoMaskPlane.transform.SetAsLastSibling(); //显示窗体下移 goDisplayPlane.transform.SetAsLastSibling(); //增加当前UI摄像机的“层深” if (_UICamear != null) { _UICamear.depth = _UICamear.depth + SysDefine.SYS_UICAMERA_DEPTH_INCREMENT; } }
public UIType(UIFormsType _UIFormsType, UIFormsShowType _UIFormsShowType, UIFormsLucencyType _UIFormsLucencyType) { this._UIFormsType = _UIFormsType; this._UIFormsShowType = _UIFormsShowType; this._UIFormsLucencyType = _UIFormsLucencyType; }