From cb57b5d077fc1170459d7edebc4c5d8701c22416 Mon Sep 17 00:00:00 2001 From: client_Wu Xijin <364452445@qq.com> Date: 星期日, 21 十月 2018 16:15:15 +0800 Subject: [PATCH] 3335 更新lua库 --- Assets/XLua/Gen/UnityEngineTransformWrap.cs | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 49 insertions(+), 1 deletions(-) diff --git a/Assets/XLua/Gen/UnityEngineTransformWrap.cs b/Assets/XLua/Gen/UnityEngineTransformWrap.cs index 4c60350..e8b2efe 100644 --- a/Assets/XLua/Gen/UnityEngineTransformWrap.cs +++ b/Assets/XLua/Gen/UnityEngineTransformWrap.cs @@ -21,7 +21,7 @@ { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Type type = typeof(UnityEngine.Transform); - Utils.BeginObjectRegister(type, L, translator, 0, 24, 19, 13); + Utils.BeginObjectRegister(type, L, translator, 0, 25, 19, 13); Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetParent", _m_SetParent); Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetPositionAndRotation", _m_SetPositionAndRotation); @@ -46,6 +46,7 @@ Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetChild", _m_GetChild); Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetParentEx", _m_SetParentEx); Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetChildTransformDeeply", _m_GetChildTransformDeeply); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetPosition", _m_SetPosition); Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetRoot", _m_GetRoot); @@ -1081,6 +1082,53 @@ } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SetPosition(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 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_TBOOLEAN == LuaAPI.lua_type(L, 5)) + { + float _x = (float)LuaAPI.lua_tonumber(L, 2); + float _y = (float)LuaAPI.lua_tonumber(L, 3); + float _z = (float)LuaAPI.lua_tonumber(L, 4); + bool _isLocal = LuaAPI.lua_toboolean(L, 5); + + gen_to_be_invoked.SetPosition( _x, _y, _z, _isLocal ); + + + + return 0; + } + if(gen_param_count == 4&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) + { + float _x = (float)LuaAPI.lua_tonumber(L, 2); + float _y = (float)LuaAPI.lua_tonumber(L, 3); + float _z = (float)LuaAPI.lua_tonumber(L, 4); + + gen_to_be_invoked.SetPosition( _x, _y, _z ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Transform.SetPosition!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_GetRoot(RealStatePtr L) { try { -- Gitblit v1.8.0