// Use this for initialization public static UIMaskMgr GetInstance() { if (_Instance = null) { _Instance = new GameObject("_UIMaskMgr").AddComponent <UIMaskMgr>(); } return(_Instance); }
private void Start() { instance = this; traRoot = GameObject.FindGameObjectWithTag(SysDefine.canvasTag).transform; traUISprites = UnityHelper.Find(traRoot, SysDefine.scriptsMgrNode); //把脚本节点添加到总脚本的子节点 UnityHelper.SetParent(traUISprites, gameObject.transform); //得到顶层面版 遮罩面板 TopPanle = traRoot; MaskPanle = UnityHelper.Find(traRoot, "UIMaskPanel"); //得到UI摄像机原始的层深 UICamera = GameObject.FindGameObjectWithTag(SysDefine.UICameraTag).GetComponent <Camera>(); if (UICamera != null) { OriginalUICameraDepth = UICamera.depth; } else { Debug.Log($"{GetType()} UICamera==null Please Check!"); } }