Esempio n. 1
0
        private void OnLoad(string name, UnityEngine.Object obj)
        {
            if (obj == null)
            {
                Debug.LogError($"can't load UIObject :{name}");
            }

            ResStatus = ResStatus.OK;
            FrameRoot = obj as GameObject;

            FrameRootTransform = FrameRoot.GetComponent <RectTransform>();

            this.OnLoadRes();
        }
Esempio n. 2
0
        protected void OnLoadRes()
        {
            UIRootCanvas.worldCamera = FrameMgr.Instance.UICamera;

            GameObjectUtil.SetLayer(FrameRoot, LayerDefine.UIHideLayer);

            FrameRoot.name = ResName.Replace(".prefab", "");

            FrameRoot.SetActive(true);

            m_frameRenderer = new FrameVisibilityComponent(this);

            uiTweens = FrameRoot.GetComponentsInChildren <UITweenerBase>(false);

            OnFrameLoaded?.Invoke(this);

            //干掉没有用的Graphic
            m_frameRenderer.OptimizeFrameGraphic();
        }