Exemplo n.º 1
0
        private static void OnLoadAssetBundle(string cacheUrl, Action <AssetBundle> callback)
        {
            AssetBundle obj = AssetPool.GetAsset(cacheUrl) as AssetBundle;

            if (callback != null)
            {
                callback(obj);
            }
        }
Exemplo n.º 2
0
        private static void OnLoadImage(string cacheUrl, Action <Texture2D> callback)
        {
            Texture2D obj = AssetPool.GetAsset(cacheUrl) as Texture2D;

            if (callback != null)
            {
                callback(obj);
            }
        }
Exemplo n.º 3
0
        private static void OnLoadPrefab(string cacheUrl, Action <GameObject> callback)
        {
            GameObject gameObject = AssetPool.GetAsset(cacheUrl) as GameObject;
            GameObject obj        = null;

            if (gameObject != null)
            {
                obj = (UnityEngine.Object.Instantiate(gameObject) as GameObject);
            }
            if (callback != null)
            {
                callback(obj);
            }
        }
Exemplo n.º 4
0
        public static byte[] GetLuaBytes(string name)
        {
            string key = name + ".lua";

            UnityEngine.Object @object = AssetPool.GetAsset(key);
            if (@object != null)
            {
                return((@object as TextAsset).bytes);
            }
            @object = AssetPool.FindLuaAsset(key);
            if (@object != null)
            {
                return((@object as TextAsset).bytes);
            }
            return(null);
        }
Exemplo n.º 5
0
        public static UnityEngine.Object GetAsset(string url)
        {
            string cachedAssetUrl = CacheManager.GetCachedAssetUrl(url);

            return(AssetPool.GetAsset(cachedAssetUrl));
        }