Main/Assets/GameAssets/Resources/GameUI/XLua/Gen/UnityEngine_PlayerPrefsWrap.cs

388 lines
12 KiB
C#
Raw Normal View History

2025-01-25 04:38:09 +08:00
#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 UnityEnginePlayerPrefsWrap
{
public static void __Register(RealStatePtr L)
{
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
System.Type type = typeof(UnityEngine.PlayerPrefs);
Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
Utils.EndObjectRegister(type, L, translator, null, null,
null, null, null);
Utils.BeginClassRegister(type, L, __CreateInstance, 11, 0, 0);
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetInt", _m_SetInt_xlua_st_);
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetInt", _m_GetInt_xlua_st_);
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetFloat", _m_SetFloat_xlua_st_);
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetFloat", _m_GetFloat_xlua_st_);
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetString", _m_SetString_xlua_st_);
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetString", _m_GetString_xlua_st_);
Utils.RegisterFunc(L, Utils.CLS_IDX, "HasKey", _m_HasKey_xlua_st_);
Utils.RegisterFunc(L, Utils.CLS_IDX, "DeleteKey", _m_DeleteKey_xlua_st_);
Utils.RegisterFunc(L, Utils.CLS_IDX, "DeleteAll", _m_DeleteAll_xlua_st_);
Utils.RegisterFunc(L, Utils.CLS_IDX, "Save", _m_Save_xlua_st_);
Utils.EndClassRegister(type, L, translator);
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int __CreateInstance(RealStatePtr L)
{
try {
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
if(LuaAPI.lua_gettop(L) == 1)
{
UnityEngine.PlayerPrefs gen_ret = new UnityEngine.PlayerPrefs();
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 UnityEngine.PlayerPrefs constructor!");
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_SetInt_xlua_st_(RealStatePtr L)
{
try {
{
string _key = LuaAPI.lua_tostring(L, 1);
int _value = LuaAPI.xlua_tointeger(L, 2);
UnityEngine.PlayerPrefs.SetInt( _key, _value );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_GetInt_xlua_st_(RealStatePtr L)
{
try {
int gen_param_count = LuaAPI.lua_gettop(L);
if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING))
{
string _key = LuaAPI.lua_tostring(L, 1);
int gen_ret = UnityEngine.PlayerPrefs.GetInt( _key );
LuaAPI.xlua_pushinteger(L, gen_ret);
return 1;
}
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
{
string _key = LuaAPI.lua_tostring(L, 1);
int _defaultValue = LuaAPI.xlua_tointeger(L, 2);
int gen_ret = UnityEngine.PlayerPrefs.GetInt( _key, _defaultValue );
LuaAPI.xlua_pushinteger(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 UnityEngine.PlayerPrefs.GetInt!");
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_SetFloat_xlua_st_(RealStatePtr L)
{
try {
{
string _key = LuaAPI.lua_tostring(L, 1);
float _value = (float)LuaAPI.lua_tonumber(L, 2);
UnityEngine.PlayerPrefs.SetFloat( _key, _value );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_GetFloat_xlua_st_(RealStatePtr L)
{
try {
int gen_param_count = LuaAPI.lua_gettop(L);
if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING))
{
string _key = LuaAPI.lua_tostring(L, 1);
float gen_ret = UnityEngine.PlayerPrefs.GetFloat( _key );
LuaAPI.lua_pushnumber(L, gen_ret);
return 1;
}
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
{
string _key = LuaAPI.lua_tostring(L, 1);
float _defaultValue = (float)LuaAPI.lua_tonumber(L, 2);
float gen_ret = UnityEngine.PlayerPrefs.GetFloat( _key, _defaultValue );
LuaAPI.lua_pushnumber(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 UnityEngine.PlayerPrefs.GetFloat!");
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_SetString_xlua_st_(RealStatePtr L)
{
try {
{
string _key = LuaAPI.lua_tostring(L, 1);
string _value = LuaAPI.lua_tostring(L, 2);
UnityEngine.PlayerPrefs.SetString( _key, _value );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_GetString_xlua_st_(RealStatePtr L)
{
try {
int gen_param_count = LuaAPI.lua_gettop(L);
if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING))
{
string _key = LuaAPI.lua_tostring(L, 1);
string gen_ret = UnityEngine.PlayerPrefs.GetString( _key );
LuaAPI.lua_pushstring(L, gen_ret);
return 1;
}
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
{
string _key = LuaAPI.lua_tostring(L, 1);
string _defaultValue = LuaAPI.lua_tostring(L, 2);
string gen_ret = UnityEngine.PlayerPrefs.GetString( _key, _defaultValue );
LuaAPI.lua_pushstring(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 UnityEngine.PlayerPrefs.GetString!");
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_HasKey_xlua_st_(RealStatePtr L)
{
try {
{
string _key = LuaAPI.lua_tostring(L, 1);
bool gen_ret = UnityEngine.PlayerPrefs.HasKey( _key );
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_DeleteKey_xlua_st_(RealStatePtr L)
{
try {
{
string _key = LuaAPI.lua_tostring(L, 1);
UnityEngine.PlayerPrefs.DeleteKey( _key );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_DeleteAll_xlua_st_(RealStatePtr L)
{
try {
{
UnityEngine.PlayerPrefs.DeleteAll( );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_Save_xlua_st_(RealStatePtr L)
{
try {
{
UnityEngine.PlayerPrefs.Save( );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
}
}