public static void LoadAsync(string abName, string assetName, Action <Shader> 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 Shader); }; } HShader res = Get <HShader>(abName, assetName, AssetType.eShader); res.StartLoad(false, true, false, tCallBack); }
public static Shader Load(string abName, string assetName) { if (string.IsNullOrEmpty(abName) || string.IsNullOrEmpty(assetName)) { Debug.LogError("abName or assetName is null!!!"); return(null); } HShader res = Get <HShader>(abName, assetName, AssetType.eShader); res.StartLoad(true, true, false, null); return(res.AssetData.mAsset as Shader); }
//协程加载shader public AsyncRequest LoadShaderCoRequest(string abName, string assetName) { return(HShader.LoadCoRequest(abName, assetName)); }
//同步加载shader public Shader LoadShader(string abName, string assetName) { return(HShader.Load(abName, assetName)); }
//异步加载shader public void LoadShaderAsync(string abName, string assetName, Action <Shader> callback) { HShader.LoadAsync(abName, assetName, callback); }