示例#1
0
        protected T CreateTipPanel <T>(int uitag, Transform parentTrans, UIDataParent UIDataParent = null,
                                       bool isClear = false)
            where T : UIPanelParent
        {
            AFUIAttribute uiAttri = UIManager.Instance.GetClassData(uitag).Attribute as AFUIAttribute;

            if (resLoader == null)
            {
                resLoader = ResLoader.Allocate();
            }

            GameObject panel   = resLoader.InstantiateObjectSync(UIManager.Instance.GetResFrom(uiAttri.UIPath), uiAttri.UIPath, parentTrans, isClear);
            T          scripts = panel.GetComponent <T>();

            if (scripts == null)
            {
                scripts = panel.AddComponent <T>();
            }
            scripts.Open(uitag, uiAttri.UIPath, UIDataParent, UIManager.Instance.GetResFrom(uiAttri.UIPath), null);
            return(scripts);
        }
示例#2
0
        public override void Init()
        {
            base.Init();
            resLoader = new ResLoader();
            string pathPre = "";

            if (GameObject.Find("UIRoot") != null)
            {
                pathPre = "UIRoot/MainCanvas/";
            }
            else
            {
                pathPre = "UIRoot(Clone)/MainCanvas/";
            }
            BGParetnTrans     = GameObject.Find(pathPre + "BG").transform;
            BottomParetnTrans = GameObject.Find(pathPre + "Bottom").transform;
            CommonParetnTrans = GameObject.Find(pathPre + "Common").transform;
            TopParetnTrans    = GameObject.Find(pathPre + "Top").transform;
            LoadParetnTrans   = GameObject.Find(pathPre + "Loading").transform;
            TipParetnTrans    = GameObject.Find(pathPre + "Tip").transform;
        }