public void CloseUI() //调用这里就直接关了,要传参数的话,传完了再调用 { //告诉遮罩管理器,如果有遮罩的话 if (mUseMask) { mGateway.UIKit_MaskMgr.RemoveMask(this); } //告诉层级管理器 mGateway.UIKit_LayerMgr.OnUIClose(this); //手起刀落 GameObject.Destroy(mUIEntity.gameObject); //通知资源管理器,可以回收了 VFSMgr.I.RemoveUse(mUIPath); //打扫 mUIEntity = null; mUIPrefab = null; mGateway = null; mUIGameObject = null; mUICanvas = null; }
/// <summary> /// 初始化 /// </summary> public UIMaskMgr(Transform TransUIRoot, Color maskColor, XUIMgrGateway _gateway) { mGateway = _gateway; MaskGo = TransUIRoot.gameObject.FindOrCreateGo("UIMask"); MaskCanvas = MaskGo.GetComponentOrAdd <Canvas>(); MaskCanvas.overrideSorting = true; MaskCanvas.sortingOrder = 0; var mask_gr = MaskGo.GetComponentOrAdd <GraphicRaycaster>(); mask_gr.ignoreReversedGraphics = true; var rect_mask_trans = MaskGo.GetComponent <RectTransform>(); rect_mask_trans.anchorMin = Vector2.zero; rect_mask_trans.anchorMax = Vector2.one; rect_mask_trans.anchoredPosition3D = Vector3.zero; rect_mask_trans.localScale = Vector3.one; rect_mask_trans.sizeDelta = Vector2.zero; var go_img_mask = MaskGo.FindOrCreateGo("Mask"); var img_mask = go_img_mask.GetComponentOrAdd <XImage>(); img_mask.color = maskColor; var rect_img = go_img_mask.GetComponent <RectTransform>(); rect_img.anchorMin = Vector2.zero; rect_img.anchorMax = Vector2.one; rect_img.anchoredPosition3D = Vector3.zero; rect_img.localScale = Vector3.one; rect_img.sizeDelta = Vector2.zero; go_img_mask.GetComponentOrAdd <Button>().onClick.AddListener(OnMaskClicked); MaskGo.SetLayerRecursive(5); MaskGo.Hide(); }
public UIItem(GameObject _prefab, string _ui_path, XUIMgrGateway _gatewayMgr) { mUIPrefab = _prefab; mUIPath = _ui_path; mGateway = _gatewayMgr; }
public UILayerMgr(XUIMgrGateway _gateway) { mGateway = _gateway; }
public XUIManagerAdv(XUIMgrGateway _Gateway, IVFS _vfs) { mVFS = _vfs; mGateway = _Gateway; }
public XUIManagerAdv(XUIMgrGateway _Gateway) { mGateway = _Gateway; }
public XUIManager(XUIMgrGateway _Gateway, IVFS _vfs) { mGateway = _Gateway; mVFS = _vfs; }