Exemple #1
0
 //初始化核心数据,加载“UI窗体路径”到集合中。
 public override void Initialize()
 {
     uiMaskMgr = gameMain.uiMaskMgr;
     //初始化加载(根UI窗体)Canvas预设
     InitRootCanvasLoading();
     //得到UI根节点、全屏节点、固定节点、弹出节点
     if (CanvasGO != null)
     {
         _TraCanvasTransfrom = CanvasGO.transform;
     }
     else
     {
         _TraCanvasTransfrom = GameObject.FindGameObjectWithTag(Common.SYS_TAG_CANVAS).transform;
         Debug.LogError("加载Canvas失败");
     }
     _TraNormal = UnityHelper.FindTheChildNode(_TraCanvasTransfrom.gameObject, Common.SYS_NORMAL_NODE);
     _TraFixed  = UnityHelper.FindTheChildNode(_TraCanvasTransfrom.gameObject, Common.SYS_FIXED_NODE);
     _TraPopUp  = UnityHelper.FindTheChildNode(_TraCanvasTransfrom.gameObject, Common.SYS_POPUP_NODE);
     UICamera   = UnityHelper.FindTheChildNode(_TraCanvasTransfrom.gameObject, "UICamera").GetComponent <Camera>();
 }
Exemple #2
0
 public override void Initialize()
 {
     //字段初始化
     uiManager = gameMain.uiManager;
     //得到UI根节点对象、脚本节点对象
     canvasGO = uiManager.CanvasGO;
     //把本脚本实例,作为“脚本节点对象”的子节点。
     //UnityHelper.AddChildNodeToParentNode(_TraUIScriptsNode, this.gameObject.transform);
     //得到“顶层面板”、“遮罩面板”
     _GoTopPanel  = canvasGO;
     _GoMaskPanel = UnityHelper.FindTheChildNode(canvasGO, "UIMaskPanel").gameObject;
     //得到UI摄像机原始的“层深”
     _UICamera = uiManager.UICamera;
     if (_UICamera != null)
     {
         //得到UI摄像机原始“层深”
         _OriginalUICameralDepth = _UICamera.depth;
     }
     else
     {
         Debug.Log(GetType() + "/Start()/UI_Camera is Null!,Please Check! ");
     }
 }