Exemple #1
0
        public static UIPanel Load(string panelName, string assetBundleName = null)
        {
            var panelLoader = new DefaultPanelLoader();
            var panelPrefab = assetBundleName.IsNullOrEmpty()
                ? panelLoader.LoadPanelPrefab(panelName)
                : panelLoader.LoadPanelPrefab(assetBundleName, panelName);
            var obj       = Instantiate(panelPrefab);
            var retScript = obj.GetComponent <UIPanel>();

            retScript.mPanelLoader = panelLoader;
            return(retScript);
        }
        public virtual IPanel LoadPanel(PanelSearchKeys panelSearchKeys)
        {
            var panelLoader = new DefaultPanelLoader();

            panelLoader.LoadPanelPrefab(panelSearchKeys);

            var panelPrefab = panelLoader.LoadPanelPrefab(panelSearchKeys);

            var obj = Object.Instantiate(panelPrefab);

            var retScript = obj.GetComponent <UIPanel>();

            retScript.As <IPanel>().Loader = panelLoader;

            Debug.Log(retScript.As <IPanel>());

            return(retScript);
        }