예제 #1
0
        public static void LoadAsync(string abName, string assetName, Action <Texture> callback)
        {
            if (string.IsNullOrEmpty(abName) || string.IsNullOrEmpty(assetName))
            {
                Debug.LogError("abName or assetName is null!!!");
                if (callback != null)
                {
                    callback(null);
                }
                return;
            }

            Action <AssetLoadData> tCallBack = null;

            if (callback != null)
            {
                tCallBack = (data) =>
                {
                    callback(data.mAsset as Texture);
                };
            }

            HTexture res = Get <HTexture>(abName, assetName, AssetType.eTexture);

            res.StartLoad(false, false, false, tCallBack);
        }
예제 #2
0
        public static Texture Load(string abName, string assetName)
        {
            if (string.IsNullOrEmpty(abName) || string.IsNullOrEmpty(assetName))
            {
                Debug.LogError("abName or assetName is null!!!");
                return(null);
            }

            HTexture res = Get <HTexture>(abName, assetName, AssetType.eTexture);

            res.StartLoad(true, false, false, null);
            return(res.AssetData.mAsset as Texture);
        }
예제 #3
0
 //协程加载贴图
 public AsyncRequest LoadTextureCoRequest(string abName, string assetName)
 {
     return(HTexture.LoadCoRequest(abName, assetName));
 }
예제 #4
0
 //同步加载贴图
 public Texture LoadTexture(string abName, string assetName)
 {
     return(HTexture.Load(abName, assetName));
 }
예제 #5
0
 //异步加载贴图
 public void LoadTextureAsync(string abName, string assetName, Action <Texture> callback)
 {
     HTexture.LoadAsync(abName, assetName, callback);
 }