133 lines
4.2 KiB
C#
133 lines
4.2 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 UnityEngineBuildCompressionWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(UnityEngine.BuildCompression);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 3, 0);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "compression", _g_get_compression);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "level", _g_get_level);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "blockSize", _g_get_blockSize);
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 6, 0, 0);
|
|
|
|
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Uncompressed", UnityEngine.BuildCompression.Uncompressed);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "LZ4", UnityEngine.BuildCompression.LZ4);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "LZMA", UnityEngine.BuildCompression.LZMA);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "UncompressedRuntime", UnityEngine.BuildCompression.UncompressedRuntime);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "LZ4Runtime", UnityEngine.BuildCompression.LZ4Runtime);
|
|
|
|
|
|
|
|
|
|
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)
|
|
{
|
|
translator.Push(L, default(UnityEngine.BuildCompression));
|
|
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.BuildCompression constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_compression(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.BuildCompression gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.Push(L, gen_to_be_invoked.compression);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_level(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.BuildCompression gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.Push(L, gen_to_be_invoked.level);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_blockSize(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.BuildCompression gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.xlua_pushuint(L, gen_to_be_invoked.blockSize);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|