#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 SystemSettingWrap
|
{
|
public static void __Register(RealStatePtr L)
|
{
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
System.Type type = typeof(SystemSetting);
|
Utils.BeginObjectRegister(type, L, translator, 0, 17, 1, 1);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetSoundVolume", _m_SetSoundVolume);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSoundVolume", _m_GetSoundVolume);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetSoundEffect", _m_SetSoundEffect);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSoundEffect", _m_GetSoundEffect);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetGameFps", _m_SetGameFps);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetGameFps", _m_GetGameFps);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetSystemSettingSwitch", _m_SetSystemSettingSwitch);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSystemSettingSwitch", _m_GetSystemSettingSwitch);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetPlayerSyncCount", _m_SetPlayerSyncCount);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetPlayerSyncCount", _m_GetPlayerSyncCount);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetQualityLevel", _m_SetQualityLevel);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetCurrentQualityLevel", _m_GetCurrentQualityLevel);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LetFPSUnLimit", _m_LetFPSUnLimit);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnSettingChanged", _e_OnSettingChanged);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "qualityLevelChangeEvent", _e_qualityLevelChangeEvent);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "playerSyncCountChangeEvent", _e_playerSyncCountChangeEvent);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "gameFrameChangeEvent", _e_gameFrameChangeEvent);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "systemSettings", _g_get_systemSettings);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "systemSettings", _s_set_systemSettings);
|
|
|
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)
|
{
|
|
SystemSetting gen_ret = new SystemSetting();
|
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 SystemSetting constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_SetSoundVolume(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
float __volume = (float)LuaAPI.lua_tonumber(L, 2);
|
|
gen_to_be_invoked.SetSoundVolume( __volume );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetSoundVolume(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
float gen_ret = gen_to_be_invoked.GetSoundVolume( );
|
LuaAPI.lua_pushnumber(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_SetSoundEffect(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
float _value = (float)LuaAPI.lua_tonumber(L, 2);
|
|
gen_to_be_invoked.SetSoundEffect( _value );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetSoundEffect(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
float gen_ret = gen_to_be_invoked.GetSoundEffect( );
|
LuaAPI.lua_pushnumber(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_SetGameFps(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
GameFps __frame;translator.Get(L, 2, out __frame);
|
|
gen_to_be_invoked.SetGameFps( __frame );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetGameFps(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
GameFps gen_ret = gen_to_be_invoked.GetGameFps( );
|
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_SetSystemSettingSwitch(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
SystemSwitch _type;translator.Get(L, 2, out _type);
|
bool __value = LuaAPI.lua_toboolean(L, 3);
|
|
gen_to_be_invoked.SetSystemSettingSwitch( _type, __value );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetSystemSettingSwitch(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
SystemSwitch _type;translator.Get(L, 2, out _type);
|
|
bool gen_ret = gen_to_be_invoked.GetSystemSettingSwitch( _type );
|
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_SetPlayerSyncCount(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
int __syncCount = LuaAPI.xlua_tointeger(L, 2);
|
|
gen_to_be_invoked.SetPlayerSyncCount( __syncCount );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetPlayerSyncCount(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
int gen_ret = gen_to_be_invoked.GetPlayerSyncCount( );
|
LuaAPI.xlua_pushinteger(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_SetQualityLevel(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
if(gen_param_count == 3&& translator.Assignable<GameQuality>(L, 2)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3))
|
{
|
GameQuality __quality;translator.Get(L, 2, out __quality);
|
bool __disabeCamera = LuaAPI.lua_toboolean(L, 3);
|
|
gen_to_be_invoked.SetQualityLevel( __quality, __disabeCamera );
|
|
|
|
return 0;
|
}
|
if(gen_param_count == 2&& translator.Assignable<GameQuality>(L, 2))
|
{
|
GameQuality __quality;translator.Get(L, 2, out __quality);
|
|
gen_to_be_invoked.SetQualityLevel( __quality );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to SystemSetting.SetQualityLevel!");
|
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _m_GetCurrentQualityLevel(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
GameQuality gen_ret = gen_to_be_invoked.GetCurrentQualityLevel( );
|
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_LetFPSUnLimit(RealStatePtr L)
|
{
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
|
|
|
{
|
|
gen_to_be_invoked.LetFPSUnLimit( );
|
|
|
|
return 0;
|
}
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
|
}
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _g_get_systemSettings(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
translator.Push(L, gen_to_be_invoked.systemSettings);
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 1;
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _s_set_systemSettings(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
gen_to_be_invoked.systemSettings = (System.Collections.Generic.Dictionary<SystemSwitch, bool>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary<SystemSwitch, bool>));
|
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
return 0;
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _e_OnSettingChanged(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
System.Action<SystemSwitch, bool> gen_delegate = translator.GetDelegate<System.Action<SystemSwitch, bool>>(L, 3);
|
if (gen_delegate == null) {
|
return LuaAPI.luaL_error(L, "#3 need System.Action<SystemSwitch, bool>!");
|
}
|
|
if (gen_param_count == 3)
|
{
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
|
gen_to_be_invoked.OnSettingChanged += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.OnSettingChanged -= gen_delegate;
|
return 0;
|
}
|
|
}
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
LuaAPI.luaL_error(L, "invalid arguments to SystemSetting.OnSettingChanged!");
|
return 0;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _e_qualityLevelChangeEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3);
|
if (gen_delegate == null) {
|
return LuaAPI.luaL_error(L, "#3 need System.Action!");
|
}
|
|
if (gen_param_count == 3)
|
{
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
|
gen_to_be_invoked.qualityLevelChangeEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.qualityLevelChangeEvent -= gen_delegate;
|
return 0;
|
}
|
|
}
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
LuaAPI.luaL_error(L, "invalid arguments to SystemSetting.qualityLevelChangeEvent!");
|
return 0;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _e_playerSyncCountChangeEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3);
|
if (gen_delegate == null) {
|
return LuaAPI.luaL_error(L, "#3 need System.Action!");
|
}
|
|
if (gen_param_count == 3)
|
{
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
|
gen_to_be_invoked.playerSyncCountChangeEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.playerSyncCountChangeEvent -= gen_delegate;
|
return 0;
|
}
|
|
}
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
LuaAPI.luaL_error(L, "invalid arguments to SystemSetting.playerSyncCountChangeEvent!");
|
return 0;
|
}
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
static int _e_gameFrameChangeEvent(RealStatePtr L)
|
{
|
try {
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
SystemSetting gen_to_be_invoked = (SystemSetting)translator.FastGetCSObj(L, 1);
|
System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3);
|
if (gen_delegate == null) {
|
return LuaAPI.luaL_error(L, "#3 need System.Action!");
|
}
|
|
if (gen_param_count == 3)
|
{
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
|
gen_to_be_invoked.gameFrameChangeEvent += gen_delegate;
|
return 0;
|
}
|
|
|
if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
|
gen_to_be_invoked.gameFrameChangeEvent -= gen_delegate;
|
return 0;
|
}
|
|
}
|
} catch(System.Exception gen_e) {
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
}
|
LuaAPI.luaL_error(L, "invalid arguments to SystemSetting.gameFrameChangeEvent!");
|
return 0;
|
}
|
|
|
|
}
|
}
|