Beispiel #1
0
        public override bool Update()
        {
            if (Request != null)
            {
                return(false);
            }
            LoadedAssetBundle bundle = ResContext.GetLoadedAssetBundle(AssetBundleName, out DownloadingError);

            if (bundle != null)
            {
                if (Additive)
                {
                    Request = Application.LoadLevelAdditiveAsync(LevelName);
                }
                else
                {
                    Request = Application.LoadLevelAsync(LevelName);
                }
                return(false);
            }
            else
            {
                return(true);
            }
        }
 void OnGUI()
 {
     if (GUI.Button(new Rect(10, 10, 150, 30), "Generate exception"))
     {
     }
     if (GUI.Button(new Rect(10, 50, 150, 30), "Load Shuaishuai"))
     {
         ResContext.LoadAssetAsync("role/shuaishuai", "ShuaiShuai(Merged)", typeof(GameObject), OnLoadedShuaiShuai);
     }
     if (GUI.Button(new Rect(10, 90, 150, 30), "Load Joe"))
     {
         ResContext.LoadAssetAsync("role/joe", "Joe(Merged)", typeof(GameObject), OnLoadedJoe);
     }
     if (GUI.Button(new Rect(10, 130, 150, 30), "Load LittleGirl"))
     {
         ResContext.LoadAssetAsync("role/littlesister", "LittleSister(Merged)", typeof(GameObject), OnLoadedLittleSister);
     }
     if (GUI.Button(new Rect(10, 170, 150, 30), "Load Mage"))
     {
         ResContext.LoadAssetAsync("role/mage", "Mage(Merged)", typeof(GameObject), OnLoadedMage);
     }
     if (GUI.Button(new Rect(10, 210, 150, 30), "Open Login"))
     {
         ResContext.LoadAssetAsync("ui/login", "Login", typeof(GameObject), OnLoadedMage);
     }
     if (GUI.Button(new Rect(10, 250, 150, 30), " "))
     {
     }
     if (GUI.Button(new Rect(10, 290, 150, 30), " "))
     {
     }
 }
Beispiel #3
0
 public LoadAssetOperation LoadAssetAsync(string assetPath, string assetbundleName, string assetName, Type assetType, LoadAssetCallback callback = null, ResourceLoadParam param = null)
 {
     if (ResContext.IsResourceMode)
     {
         return(ResContext.LoadAssetAsync(assetPath, assetName, assetType, callback, param));
     }
     else
     {
         return(ResContext.LoadAssetAsync(assetbundleName, assetName, assetType, callback, param));
     }
 }
Beispiel #4
0
 public LoadAssetOperation IsInProgress(string assetPath, string assetbundleName, string assetName)
 {
     if (ResContext.IsResourceMode)
     {
         return(ResContext.IsInProgress(assetPath, assetName));
     }
     else
     {
         return(ResContext.IsInProgress(assetbundleName, assetName));
     }
 }
 public LoadAssetOperation LoadWindowWithResource(string resPath, LoadAssetCallback callback = null, ResourceLoadParam param = null)
 {
     if (string.IsNullOrEmpty(resPath))
     {
         return(null);
     }
     if (ResContext.IsInProgress(resPath, string.Empty) != null)
     {
         return(null);
     }
     return(ResContext.LoadAssetAsync(resPath, "", typeof(GameObject), true, callback, param));
 }
 public LoadAssetOperation LoadWindowWithAssetBundle(string bundleName, string assetName, LoadAssetCallback callback = null, ResourceLoadParam param = null)
 {
     if (string.IsNullOrEmpty(assetName))
     {
         return(null);
     }
     if (ResContext.IsInProgress(bundleName, assetName) != null)
     {
         return(null);
     }
     return(ResContext.LoadAssetAsync(bundleName, assetName, typeof(GameObject), true, callback, param));
 }
Beispiel #7
0
        public override bool Update()
        {
            if (Request != null)
            {
                return(false);
            }
            LoadedAssetBundle bundle = ResContext.GetLoadedAssetBundle(AssetBundleName, out DownloadingError);

            if (bundle != null)
            {
                Request = bundle.AssetBundle.LoadAssetAsync(AssetName, AssetType);
            }
            return(true);
        }
Beispiel #8
0
        public static void SetDevelopmentAssetBundleServer()
        {
#if UNITY_EDITOR
            if (pAssetBundleMode == ResourceMode.Debug_SimulativeAssetBundle)
            {
                return;
            }
#endif
            TextAsset urlConfig = Resources.Load("AssetBundleServerURL") as TextAsset;
            string    url       = (urlConfig != null) ? urlConfig.text.Trim() : null;
            if (url == null || url.Length == 0)
            {
                Utility.LogError("Development Server URL could not be found.");
                //AssetBundleManager.SetSourceAssetBundleURL("http://localhost:7888/" + UnityHelper.GetPlatformName() + "/");
            }
            else
            {
                ResContext.SetSourceAssetBundleURL(url);
            }
        }
        void Start()
        {
            ResContext.ListenInitializeFinish += OnResManagerInitFinish;

            ResContext.Initialize();
        }