#if USE_UNI_LUA using LuaAPI = UniLua.Lua; using RealStatePtr = UniLua.ILuaState; using LuaCSFunction = UniLua.CSharpFunctionDelegate; #else using LuaAPI = XLua.LuaDLL.Lua; using RealStatePtr = System.IntPtr; using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; #endif using XLua; using System.Collections.Generic; namespace XLua.CSObjectWrap { using Utils = XLua.Utils; public class BFResourceManagerWrap { public static void __Register(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Type type = typeof(BF.ResourceManager); Utils.BeginObjectRegister(type, L, translator, 0, 15, 2, 0); Utils.RegisterFunc(L, Utils.METHOD_IDX, "Destroy", _m_Destroy); Utils.RegisterFunc(L, Utils.METHOD_IDX, "Clear", _m_Clear); Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init); Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetAbConfigCollection", _m_SetAbConfigCollection); Utils.RegisterFunc(L, Utils.METHOD_IDX, "ReloadManifest", _m_ReloadManifest); Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadAsync", _m_LoadAsync); Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadSync", _m_LoadSync); Utils.RegisterFunc(L, Utils.METHOD_IDX, "Unload", _m_Unload); Utils.RegisterFunc(L, Utils.METHOD_IDX, "RemoveAsset", _m_RemoveAsset); Utils.RegisterFunc(L, Utils.METHOD_IDX, "UnloadAllDelayAssets", _m_UnloadAllDelayAssets); Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSceneLoadPath", _m_GetSceneLoadPath); Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadSceneAsync", _m_LoadSceneAsync); Utils.RegisterFunc(L, Utils.METHOD_IDX, "UnloadScene", _m_UnloadScene); Utils.RegisterFunc(L, Utils.METHOD_IDX, "ContainsAsset", _m_ContainsAsset); Utils.RegisterFunc(L, Utils.METHOD_IDX, "Update", _m_Update); Utils.RegisterFunc(L, Utils.GETTER_IDX, "AbConfigCollection", _g_get_AbConfigCollection); Utils.RegisterFunc(L, Utils.GETTER_IDX, "Manifest", _g_get_Manifest); Utils.EndObjectRegister(type, L, translator, null, null, null, null, null); Utils.BeginClassRegister(type, L, __CreateInstance, 4, 0, 0); Utils.RegisterFunc(L, Utils.CLS_IDX, "Create", _m_Create_xlua_st_); Utils.RegisterObject(L, translator, Utils.CLS_IDX, "TIME_OUT_LOAD", BF.ResourceManager.TIME_OUT_LOAD); Utils.RegisterObject(L, translator, Utils.CLS_IDX, "TIME_DELAY_UNLOAD", BF.ResourceManager.TIME_DELAY_UNLOAD); Utils.EndClassRegister(type, L, translator); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int __CreateInstance(RealStatePtr L) { return LuaAPI.luaL_error(L, "BF.ResourceManager does not have a constructor!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_Create_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { var gen_ret = BF.ResourceManager.Create( ); translator.Push(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_Destroy(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.Destroy( ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_Clear(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.Clear( ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_Init(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.Init( ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_SetAbConfigCollection(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { BF.AssetBundleConfigCollection _abcc = (BF.AssetBundleConfigCollection)translator.GetObject(L, 2, typeof(BF.AssetBundleConfigCollection)); gen_to_be_invoked.SetAbConfigCollection( _abcc ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_ReloadManifest(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.ReloadManifest( ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_LoadAsync(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { string _assetPath = LuaAPI.lua_tostring(L, 2); System.Type _type = (System.Type)translator.GetObject(L, 3, typeof(System.Type)); System.Action _complete = translator.GetDelegate>(L, 4); var gen_ret = gen_to_be_invoked.LoadAsync( _assetPath, _type, _complete ); LuaAPI.xlua_pushuint(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_LoadSync(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { string _assetPath = LuaAPI.lua_tostring(L, 2); System.Type _type = (System.Type)translator.GetObject(L, 3, typeof(System.Type)); var gen_ret = gen_to_be_invoked.LoadSync( _assetPath, _type ); translator.Push(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_Unload(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) { string _assetPath = LuaAPI.lua_tostring(L, 2); bool _immediately = LuaAPI.lua_toboolean(L, 3); gen_to_be_invoked.Unload( _assetPath, _immediately ); return 0; } if(gen_param_count == 3&& translator.Assignable(L, 2)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) { BF.AssetObject _assetObject = (BF.AssetObject)translator.GetObject(L, 2, typeof(BF.AssetObject)); bool _immediately = LuaAPI.lua_toboolean(L, 3); gen_to_be_invoked.Unload( _assetObject, _immediately ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return LuaAPI.luaL_error(L, "invalid arguments to BF.ResourceManager.Unload!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_RemoveAsset(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { string _assetPath = LuaAPI.lua_tostring(L, 2); gen_to_be_invoked.RemoveAsset( _assetPath ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_UnloadAllDelayAssets(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.UnloadAllDelayAssets( ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_GetSceneLoadPath(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { string _assetBundlePath = LuaAPI.lua_tostring(L, 2); var gen_ret = gen_to_be_invoked.GetSceneLoadPath( _assetBundlePath ); LuaAPI.lua_pushstring(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_LoadSceneAsync(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { string _assetBundlePath = LuaAPI.lua_tostring(L, 2); System.Action _complete = translator.GetDelegate>(L, 3); gen_to_be_invoked.LoadSceneAsync( _assetBundlePath, _complete ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_UnloadScene(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { string _assetBundlePath = LuaAPI.lua_tostring(L, 2); gen_to_be_invoked.UnloadScene( _assetBundlePath ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_ContainsAsset(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { string _assetPath = LuaAPI.lua_tostring(L, 2); var gen_ret = gen_to_be_invoked.ContainsAsset( _assetPath ); LuaAPI.lua_pushboolean(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_Update(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.Update( ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_AbConfigCollection(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.AbConfigCollection); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_Manifest(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); BF.ResourceManager gen_to_be_invoked = (BF.ResourceManager)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.Manifest); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } } }