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

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

            if (callback != null)
            {
                callback(obj);
            }
        }
예제 #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);
            }
        }
예제 #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);
        }
예제 #5
0
        public static UnityEngine.Object GetAsset(string url)
        {
            string cachedAssetUrl = CacheManager.GetCachedAssetUrl(url);

            return(AssetPool.GetAsset(cachedAssetUrl));
        }