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