2025-06-10 16:11:48 +08:00
|
|
|
|
//this source code was auto-generated by tolua#, do not modify it
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using LuaInterface;
|
|
|
|
|
|
|
|
|
|
|
|
public class Game_UtilsWrap
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void Register(LuaState L)
|
|
|
|
|
|
{
|
|
|
|
|
|
L.BeginStaticLibs("Utils");
|
|
|
|
|
|
L.RegFunction("CopyPrefab", CopyPrefab);
|
|
|
|
|
|
L.RegFunction("SetNativeObject", SetNativeObject);
|
|
|
|
|
|
L.RegFunction("GetTime", GetTime);
|
|
|
|
|
|
L.RegFunction("IsDoubleClick", IsDoubleClick);
|
|
|
|
|
|
L.RegFunction("SaveLocalFile", SaveLocalFile);
|
|
|
|
|
|
L.RegFunction("LoadLocalFile", LoadLocalFile);
|
|
|
|
|
|
L.RegFunction("ClearLocalFile", ClearLocalFile);
|
|
|
|
|
|
L.RegFunction("SaveScaledPicture", SaveScaledPicture);
|
|
|
|
|
|
L.RegFunction("LocalAddress", LocalAddress);
|
|
|
|
|
|
L.RegFunction("IsGPSEnable", IsGPSEnable);
|
|
|
|
|
|
L.RegFunction("DownloadFile", DownloadFile);
|
2025-07-09 23:48:28 +08:00
|
|
|
|
L.RegFunction("TextOmit", TextOmit);
|
2025-06-10 16:11:48 +08:00
|
|
|
|
L.EndStaticLibs();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int CopyPrefab(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 1);
|
|
|
|
|
|
UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
|
|
|
|
|
|
UnityEngine.GameObject o = Game.Utils.CopyPrefab(arg0);
|
|
|
|
|
|
ToLua.PushSealed(L, o);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int SetNativeObject(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 2);
|
|
|
|
|
|
FairyGUI.GObject arg0 = (FairyGUI.GObject)ToLua.CheckObject<FairyGUI.GObject>(L, 1);
|
|
|
|
|
|
string arg1 = ToLua.CheckString(L, 2);
|
|
|
|
|
|
Game.Utils.SetNativeObject(arg0, arg1);
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int GetTime(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 1);
|
|
|
|
|
|
long arg0 = LuaDLL.tolua_checkint64(L, 1);
|
|
|
|
|
|
string o = Game.Utils.GetTime(arg0);
|
|
|
|
|
|
LuaDLL.lua_pushstring(L, o);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int IsDoubleClick(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 1);
|
|
|
|
|
|
FairyGUI.EventContext arg0 = (FairyGUI.EventContext)ToLua.CheckObject<FairyGUI.EventContext>(L, 1);
|
|
|
|
|
|
bool o = Game.Utils.IsDoubleClick(arg0);
|
|
|
|
|
|
LuaDLL.lua_pushboolean(L, o);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int SaveLocalFile(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 2);
|
|
|
|
|
|
string arg0 = ToLua.CheckString(L, 1);
|
|
|
|
|
|
string arg1 = ToLua.CheckString(L, 2);
|
|
|
|
|
|
Game.Utils.SaveLocalFile(arg0, arg1);
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int LoadLocalFile(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 1);
|
|
|
|
|
|
string arg0 = ToLua.CheckString(L, 1);
|
|
|
|
|
|
string o = Game.Utils.LoadLocalFile(arg0);
|
|
|
|
|
|
LuaDLL.lua_pushstring(L, o);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int ClearLocalFile(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 1);
|
|
|
|
|
|
long arg0 = LuaDLL.tolua_checkint64(L, 1);
|
|
|
|
|
|
Game.Utils.ClearLocalFile(arg0);
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int SaveScaledPicture(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 4);
|
|
|
|
|
|
string arg0 = ToLua.CheckString(L, 1);
|
|
|
|
|
|
UnityEngine.Texture2D arg1 = (UnityEngine.Texture2D)ToLua.CheckObject(L, 2, typeof(UnityEngine.Texture2D));
|
|
|
|
|
|
int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
|
|
|
|
|
|
int arg3 = (int)LuaDLL.luaL_checknumber(L, 4);
|
|
|
|
|
|
UnityEngine.Texture2D o = Game.Utils.SaveScaledPicture(arg0, arg1, arg2, arg3);
|
|
|
|
|
|
ToLua.PushSealed(L, o);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int LocalAddress(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 1);
|
|
|
|
|
|
LuaFunction arg0 = ToLua.CheckLuaFunction(L, 1);
|
|
|
|
|
|
Game.Utils.LocalAddress(arg0);
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int IsGPSEnable(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 0);
|
|
|
|
|
|
bool o = Game.Utils.IsGPSEnable();
|
|
|
|
|
|
LuaDLL.lua_pushboolean(L, o);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int DownloadFile(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
ToLua.CheckArgsCount(L, 3);
|
|
|
|
|
|
string arg0 = ToLua.CheckString(L, 1);
|
|
|
|
|
|
string arg1 = ToLua.CheckString(L, 2);
|
|
|
|
|
|
LuaFunction arg2 = ToLua.CheckLuaFunction(L, 3);
|
|
|
|
|
|
Game.Utils.DownloadFile(arg0, arg1, arg2);
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-09 23:48:28 +08:00
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
|
|
|
|
static int TextOmit(IntPtr L)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2025-08-05 20:29:11 +08:00
|
|
|
|
ToLua.CheckArgsCount(L, 3);
|
2025-07-09 23:48:28 +08:00
|
|
|
|
string arg0 = ToLua.CheckString(L, 1);
|
|
|
|
|
|
int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
|
2025-08-05 20:29:11 +08:00
|
|
|
|
string arg2 = ToLua.CheckString(L, 3);
|
|
|
|
|
|
string o = Game.Utils.TextOmit(arg0, arg1, arg2);
|
2025-07-09 23:48:28 +08:00
|
|
|
|
LuaDLL.lua_pushstring(L, o);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-06-10 16:11:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|