Ejemplo n.º 1
0
        partial void InitInstance(CreateRoleWindow instace)
        {
            this.instace = instace;
            RoleAssetAPI roleAssetAPI = SimpleFactory.CreateRoleAssetAPI();

            MonoInst.RunConrotine(roleAssetAPI.CreateRoleIEnumerator((AssetBundle bundle) =>
            {
                allButtons = instace.m_RoleList.GetChildren();
                allRole    = bundle.LoadAllAssets <Texture>();
                SetTexture(0);
                SetDetailInfo(0);



                MyGLoader loader = new MyGLoader();
                loader.position  = instace.m_htmlText.position;
                loader.LoadAsset("icon", allRole[0]);
                string richText         = string.Format(@"This is the Rich Text <img src='icon' width='20' height='20'/>");
                instace.m_htmlText.text = richText;
                HtmlElement htmlElement = instace.m_htmlText.richTextField.GetHtmlElementAt(0);

                instace.AddChild(loader);
            }
                                                                     ));

            instace.m_HintText.m_TextContent.text = "This is the HintInfo";

            instace.m_BaseWindow.m_BackTitleButton.m_Title.text = "RoleCreate";
            instace.m_Next.onClick.Add(HandleNextClick);
            instace.Disposable = true;
            instace.m_RoleList.GetChildren();
            instace.m_RoleList.onClickItem.Add(EventCallback1);
        }
Ejemplo n.º 2
0
        IEnumerator DownLoadAsset(string assetName, DownLoadHelpAPI downLoadHelper)
        {
            string loadpath = string.Format("{0}/{1}", SimpleFactory.CreatePathHelperAPI().AppContentPath(), assetName);

            Debug.Log(loadpath);
            WWW assetData = new WWW(loadpath);

            yield return(assetData);

            // Debug.Log(loadpath);

            if (assetData.error != null)
            {
                Debug.Log(assetData.error);
                yield break;
            }
            AssetBundle assetBundle;

            if (assetData.isDone)
            {
                assetBundle = AssetBundle.LoadFromMemory(assetData.bytes);
                BundleReferenceAPI bundleReference = SimpleFactory.CreateBundleReferenceAPI();
                bundleReference.InitBundle(assetBundle);
                bundlelist.Add(assetName, bundleReference);
                downLoadHelper.OnLoadAssetBundle(assetBundle);
            }
            yield return(null);
        }
Ejemplo n.º 3
0
 private void Start()
 {
     Instance = this;
     UIObjectFactory.SetLoaderExtension(typeof(MyGLoader));
     MonoInst.SetupMono(this);
     SimpleFactory.CreateAppStart().StartApp(this);
 }
Ejemplo n.º 4
0
        public static IEnumerator DownLoadAssetBundle(string bundleName, OnLoadBundleFinish onLoadBundleFinish)
        {
            ResourceAPI      resourceAPI      = SimpleFactory.CreateResourceAPI();
            DownLoadEventAPI downLoadEventAPI = SimpleFactory.CreateDownLoadEventAPI();

            downLoadEventAPI.OnLoadBundleDelegate += onLoadBundleFinish;
            yield return(resourceAPI.LoadAssetBundle(bundleName, downLoadEventAPI));
        }
Ejemplo n.º 5
0
        IEnumerator CreateIEnumerator()
        {
            ResourceAPI      resourceAPI      = SimpleFactory.CreateResourceAPI();
            DownLoadEventAPI downLoadEventAPI = SimpleFactory.CreateDownLoadEventAPI();

            downLoadEventAPI.OnLoadBundleDelegate += (AssetBundle bundle) =>
            {
                UIPackage.AddPackage(bundle);
                this.Inst <WindowManage>().OpenWindow(WindowNameFactory.GetLoginWindowName());
            };
            yield return(resourceAPI.LoadAssetBundle(BundleConst.WindowframeBundleName, downLoadEventAPI));
        }
Ejemplo n.º 6
0
        public IEnumerator LoadAssetBundle(string keyName, DownLoadEventAPI combineLoadHelp)
        {
            AssetBundle assetBundle = null;
            bool        hasBundle   = bundlelist.ContainsKey(keyName) && bundlelist[keyName].Bundle != null;

            if (!hasBundle)
            {
                DownLoadHelpAPI downLoadHelp = SimpleFactory.CreateDownLoadHelpAPI();
                yield return(DownLoadAsset(keyName, downLoadHelp));
            }

            if (bundlelist.ContainsKey(keyName))
            {
                assetBundle = bundlelist[keyName].PlusCount();
            }
            if (assetBundle != null)
            {
                combineLoadHelp.OnLoadAssetBundle(assetBundle);
            }
            yield return(null);
        }