| New file |
| | |
| | | #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 UnityEngineKeyframeWrap |
| | | { |
| | | public static void __Register(RealStatePtr L) |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(UnityEngine.Keyframe); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 0, 5, 5); |
| | | |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "time", _g_get_time); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "value", _g_get_value); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "inTangent", _g_get_inTangent); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "outTangent", _g_get_outTangent); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "tangentMode", _g_get_tangentMode); |
| | | |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "time", _s_set_time); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "value", _s_set_value); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "inTangent", _s_set_inTangent); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "outTangent", _s_set_outTangent); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "tangentMode", _s_set_tangentMode); |
| | | |
| | | |
| | | 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 { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | if(LuaAPI.lua_gettop(L) == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) |
| | | { |
| | | float _time = (float)LuaAPI.lua_tonumber(L, 2); |
| | | float _value = (float)LuaAPI.lua_tonumber(L, 3); |
| | | |
| | | UnityEngine.Keyframe gen_ret = new UnityEngine.Keyframe(_time, _value); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | return 1; |
| | | } |
| | | if(LuaAPI.lua_gettop(L) == 5 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5)) |
| | | { |
| | | float _time = (float)LuaAPI.lua_tonumber(L, 2); |
| | | float _value = (float)LuaAPI.lua_tonumber(L, 3); |
| | | float _inTangent = (float)LuaAPI.lua_tonumber(L, 4); |
| | | float _outTangent = (float)LuaAPI.lua_tonumber(L, 5); |
| | | |
| | | UnityEngine.Keyframe gen_ret = new UnityEngine.Keyframe(_time, _value, _inTangent, _outTangent); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | if (LuaAPI.lua_gettop(L) == 1) |
| | | { |
| | | translator.Push(L, default(UnityEngine.Keyframe)); |
| | | 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.Keyframe constructor!"); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_time(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Keyframe gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.time); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_value(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Keyframe gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.value); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_inTangent(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Keyframe gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.inTangent); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_outTangent(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Keyframe gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.outTangent); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_tangentMode(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Keyframe gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.tangentMode); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_time(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Keyframe gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | gen_to_be_invoked.time = (float)LuaAPI.lua_tonumber(L, 2); |
| | | |
| | | translator.Update(L, 1, gen_to_be_invoked); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_value(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Keyframe gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | gen_to_be_invoked.value = (float)LuaAPI.lua_tonumber(L, 2); |
| | | |
| | | translator.Update(L, 1, gen_to_be_invoked); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_inTangent(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Keyframe gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | gen_to_be_invoked.inTangent = (float)LuaAPI.lua_tonumber(L, 2); |
| | | |
| | | translator.Update(L, 1, gen_to_be_invoked); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_outTangent(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Keyframe gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | gen_to_be_invoked.outTangent = (float)LuaAPI.lua_tonumber(L, 2); |
| | | |
| | | translator.Update(L, 1, gen_to_be_invoked); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_tangentMode(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Keyframe gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | gen_to_be_invoked.tangentMode = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | translator.Update(L, 1, gen_to_be_invoked); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |