285 lines
8.7 KiB
C#
285 lines
8.7 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 UnityEngineDynamicGIWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(UnityEngine.DynamicGI);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 4, 5, 4);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetEmissive", _m_SetEmissive_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetEnvironmentData", _m_SetEnvironmentData_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "UpdateEnvironment", _m_UpdateEnvironment_xlua_st_);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "indirectScale", _g_get_indirectScale);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "updateThreshold", _g_get_updateThreshold);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "materialUpdateTimeSlice", _g_get_materialUpdateTimeSlice);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "synchronousMode", _g_get_synchronousMode);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "isConverged", _g_get_isConverged);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "indirectScale", _s_set_indirectScale);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "updateThreshold", _s_set_updateThreshold);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "materialUpdateTimeSlice", _s_set_materialUpdateTimeSlice);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "synchronousMode", _s_set_synchronousMode);
|
|
|
|
|
|
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)
|
|
{
|
|
|
|
var gen_ret = new UnityEngine.DynamicGI();
|
|
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.DynamicGI constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetEmissive_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Renderer _renderer = (UnityEngine.Renderer)translator.GetObject(L, 1, typeof(UnityEngine.Renderer));
|
|
UnityEngine.Color _color;translator.Get(L, 2, out _color);
|
|
|
|
UnityEngine.DynamicGI.SetEmissive( _renderer, _color );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetEnvironmentData_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
float[] _input = (float[])translator.GetObject(L, 1, typeof(float[]));
|
|
|
|
UnityEngine.DynamicGI.SetEnvironmentData( _input );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_UpdateEnvironment_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
UnityEngine.DynamicGI.UpdateEnvironment( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_indirectScale(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushnumber(L, UnityEngine.DynamicGI.indirectScale);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_updateThreshold(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushnumber(L, UnityEngine.DynamicGI.updateThreshold);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_materialUpdateTimeSlice(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.xlua_pushinteger(L, UnityEngine.DynamicGI.materialUpdateTimeSlice);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_synchronousMode(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushboolean(L, UnityEngine.DynamicGI.synchronousMode);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_isConverged(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.lua_pushboolean(L, UnityEngine.DynamicGI.isConverged);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_indirectScale(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
UnityEngine.DynamicGI.indirectScale = (float)LuaAPI.lua_tonumber(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_updateThreshold(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
UnityEngine.DynamicGI.updateThreshold = (float)LuaAPI.lua_tonumber(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_materialUpdateTimeSlice(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
UnityEngine.DynamicGI.materialUpdateTimeSlice = LuaAPI.xlua_tointeger(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_synchronousMode(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
UnityEngine.DynamicGI.synchronousMode = LuaAPI.lua_toboolean(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|