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

            HMaterial res = Get <HMaterial>(abName, assetName, AssetType.eMaterial);

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

            HMaterial res = Get <HMaterial>(abName, assetName, AssetType.eMaterial);

            res.StartLoad(true, false, false, null);
            return(res.AssetData.mAsset as Material);
        }
Example #3
0
 //协程加载材质
 public AsyncRequest LoadMaterialCoRequest(string abName, string assetName)
 {
     return(HMaterial.LoadCoRequest(abName, assetName));
 }
Example #4
0
 //同步加载材质
 public Material LoadMaterial(string abName, string assetName)
 {
     return(HMaterial.Load(abName, assetName));
 }
Example #5
0
 //异步加载材质
 public void LoadMaterialAsync(string abName, string assetName, Action <Material> callback)
 {
     HMaterial.LoadAsync(abName, assetName, callback);
 }