Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 //协程加载lua
 public AsyncRequest LoadLuaCoRequest(string abName, string assetName)
 {
     return(HLua.LoadCoRequest(abName, assetName));
 }
Пример #4
0
 //同步加载lua
 public TextAsset LoadLua(string abName, string assetName)
 {
     return(HLua.Load(abName, assetName));
 }
Пример #5
0
 //异步加载lua
 public void LoadLuaAsync(string abName, string assetName, Action <TextAsset> callback)
 {
     HLua.LoadAsync(abName, assetName, callback);
 }