300 lines
10 KiB
C#
300 lines
10 KiB
C#
#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 BFAssetBundleConfigWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(BF.AssetBundleConfig);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 1, 6, 6);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ToString", _m_ToString);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "assetBundlePath", _g_get_assetBundlePath);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "assetsPath", _g_get_assetsPath);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "md5", _g_get_md5);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "zipPath", _g_get_zipPath);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "rawSize", _g_get_rawSize);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "location", _g_get_location);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "assetBundlePath", _s_set_assetBundlePath);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "assetsPath", _s_set_assetsPath);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "md5", _s_set_md5);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "zipPath", _s_set_zipPath);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "rawSize", _s_set_rawSize);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "location", _s_set_location);
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndClassRegister(type, L, translator);
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __CreateInstance(RealStatePtr L)
|
|
{
|
|
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
if(LuaAPI.lua_gettop(L) == 1)
|
|
{
|
|
|
|
var gen_ret = new BF.AssetBundleConfig();
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to BF.AssetBundleConfig constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ToString(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.ToString( );
|
|
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 _g_get_assetBundlePath(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.assetBundlePath);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_assetsPath(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.assetsPath);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_md5(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.md5);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_zipPath(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.zipPath);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_rawSize(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushint64(L, gen_to_be_invoked.rawSize);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_location(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.location);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_assetBundlePath(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.assetBundlePath = LuaAPI.lua_tostring(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_assetsPath(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.assetsPath = (string[])translator.GetObject(L, 2, typeof(string[]));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_md5(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.md5 = LuaAPI.lua_tostring(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_zipPath(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.zipPath = LuaAPI.lua_tostring(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_rawSize(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.rawSize = LuaAPI.lua_toint64(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_location(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.AssetBundleConfig gen_to_be_invoked = (BF.AssetBundleConfig)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.location = (byte)LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|