362 lines
13 KiB
C#
362 lines
13 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 UISutureTextureDataWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(UISutureTextureData);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 2, 9, 4);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Load", _m_Load);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "UnLoad", _m_UnLoad);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsValid", _g_get_IsValid);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "Left", _g_get_Left);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "Right", _g_get_Right);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "Name", _g_get_Name);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "UseCustomLoad", _g_get_UseCustomLoad);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "LeftName", _g_get_LeftName);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "RightName", _g_get_RightName);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsFromStreamFile", _g_get_IsFromStreamFile);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "FileExt", _g_get_FileExt);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "Left", _s_set_Left);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "Right", _s_set_Right);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "IsFromStreamFile", _s_set_IsFromStreamFile);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "FileExt", _s_set_FileExt);
|
|
|
|
|
|
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 {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
if(LuaAPI.lua_gettop(L) == 1)
|
|
{
|
|
|
|
UISutureTextureData gen_ret = new UISutureTextureData();
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
if(LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2))
|
|
{
|
|
bool _useCustomLoad = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
UISutureTextureData gen_ret = new UISutureTextureData(_useCustomLoad);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
if(LuaAPI.lua_gettop(L) == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable<UnityEngine.Texture2D>(L, 3) && translator.Assignable<UnityEngine.Texture2D>(L, 4))
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
UnityEngine.Texture2D _left = (UnityEngine.Texture2D)translator.GetObject(L, 3, typeof(UnityEngine.Texture2D));
|
|
UnityEngine.Texture2D _right = (UnityEngine.Texture2D)translator.GetObject(L, 4, typeof(UnityEngine.Texture2D));
|
|
|
|
UISutureTextureData gen_ret = new UISutureTextureData(_name, _left, _right);
|
|
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 UISutureTextureData constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Load(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
System.Action<bool> _loadFinished = translator.GetDelegate<System.Action<bool>>(L, 3);
|
|
|
|
gen_to_be_invoked.Load( _name, _loadFinished );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_UnLoad(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.UnLoad( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_IsValid(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsValid);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_Left(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.Left);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_Right(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.Right);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_Name(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.Name);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_UseCustomLoad(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.UseCustomLoad);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_LeftName(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.LeftName);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_RightName(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.RightName);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_IsFromStreamFile(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsFromStreamFile);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_FileExt(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushstring(L, gen_to_be_invoked.FileExt);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_Left(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.Left = (UnityEngine.Texture2D)translator.GetObject(L, 2, typeof(UnityEngine.Texture2D));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_Right(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.Right = (UnityEngine.Texture2D)translator.GetObject(L, 2, typeof(UnityEngine.Texture2D));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_IsFromStreamFile(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.IsFromStreamFile = LuaAPI.lua_toboolean(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_FileExt(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UISutureTextureData gen_to_be_invoked = (UISutureTextureData)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.FileExt = LuaAPI.lua_tostring(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|