Ejemplo n.º 1
0
        protected virtual T CreateSubPanel <T>(int uitag, Transform parentTrans, UIDataParent UIDataParent = null,
                                               bool isClear = false)
            where T : UIPanelParent
        {
            AFUIAttribute uiAttri = UIManager.Instance.GetClassData(uitag).Attribute as AFUIAttribute;
            GameObject    panel   = GetResLoader().InstantiateObjectSync(resFromType, uiAttri.UIPath, parentTrans, isClear);
            T             scripts = panel.GetComponent <T>();

            if (scripts == null)
            {
                scripts = panel.AddComponent <T>();
            }
            scripts.Open(uitag, uiAttri.UIPath, UIDataParent, resFromType, this);
            AddChildPanel(uitag, scripts);
            scriptToUITag[typeof(T).ToString()] = uitag;
            return(scripts);
        }
Ejemplo n.º 2
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);
        }