Example #1
0
        public static void LoadAsync(string abName, string assetName, Action <Sprite> 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 Sprite);
                };
            }

            HSprite res = Get <HSprite>(abName, assetName, AssetType.eSprite);

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

            HSprite res = Get <HSprite>(abName, assetName, AssetType.eSprite);

            res.StartLoad(true, true, false, null);
            return(res.AssetData.mAsset as Sprite);
        }
Example #3
0
 //协程加载图集
 public AsyncRequest LoadSpriteCoRequest(string abName, string assetName)
 {
     return(HSprite.LoadCoRequest(abName, assetName));
 }
Example #4
0
 //同步加载图集
 public Sprite LoadSprite(string abName, string assetName)
 {
     return(HSprite.Load(abName, assetName));
 }
Example #5
0
 //异步加载图集
 public void LoadSpriteAsync(string abName, string assetName, Action <Sprite> callback)
 {
     HSprite.LoadAsync(abName, assetName, callback);
 }