diff --git a/ILRuntimeDemo/Assets/Samples/ILRuntime/2.0.2/Demo/HotFix_Project~/TestPerformance.cs b/ILRuntimeDemo/Assets/Samples/ILRuntime/2.0.2/Demo/HotFix_Project~/TestPerformance.cs index 29a6e9d..d01797f 100644 --- a/ILRuntimeDemo/Assets/Samples/ILRuntime/2.0.2/Demo/HotFix_Project~/TestPerformance.cs +++ b/ILRuntimeDemo/Assets/Samples/ILRuntime/2.0.2/Demo/HotFix_Project~/TestPerformance.cs @@ -13,11 +13,11 @@ public static void TestMandelbrot(StringBuilder sb) sw.Start(); float total = Mandelbrot(64, 64, 4); sw.Stop(); - sb.AppendLine(string.Format("res=" + total + ", time:{0:0}", sw.ElapsedMilliseconds)); + sb.AppendLine(string.Format("ilruntime: use self res=" + total + ", time:{0:0}", sw.ElapsedMilliseconds)); sw.Restart(); total = Mandelbrot2(64, 64, 4); sw.Stop(); - sb.AppendLine(string.Format("res2=" + total + ", time:{0:0}", sw.ElapsedMilliseconds)); + sb.AppendLine(string.Format("ilruntime: use C# res2=" + total + ", time:{0:0}", sw.ElapsedMilliseconds)); } static bool MandelbrotCheck(float workX, float workY) diff --git a/ILRuntimeDemo/Assets/Samples/ILRuntime/2.0.2/Demo/Scripts/Examples/12_Performance/Performance.cs b/ILRuntimeDemo/Assets/Samples/ILRuntime/2.0.2/Demo/Scripts/Examples/12_Performance/Performance.cs index ca23821..4f5d1b5 100644 --- a/ILRuntimeDemo/Assets/Samples/ILRuntime/2.0.2/Demo/Scripts/Examples/12_Performance/Performance.cs +++ b/ILRuntimeDemo/Assets/Samples/ILRuntime/2.0.2/Demo/Scripts/Examples/12_Performance/Performance.cs @@ -1,4 +1,4 @@ -//#define XLUA_INSTALLED +#define XLUA_INSTALLED using UnityEngine; using System.Collections; using System.Collections.Generic; @@ -12,12 +12,12 @@ using XLua; //下面这行为了取消使用WWW的警告,Unity2018以后推荐使用UnityWebRequest,处于兼容性考虑Demo依然使用WWW #pragma warning disable CS0618 -[LuaCallCSharp] #else //下面这行为了取消使用WWW的警告,Unity2018以后推荐使用UnityWebRequest,处于兼容性考虑Demo依然使用WWW #pragma warning disable CS0618 #endif +[LuaCallCSharp] public class Performance : MonoBehaviour { public Button btnLoadStack; @@ -29,6 +29,7 @@ public class Performance : MonoBehaviour //AppDomain是ILRuntime的入口,最好是在一个单例类中保存,整个游戏全局就一个,这里为了示例方便,每个例子里面都单独做了一个 //大家在正式项目中请全局只创建一个AppDomain AppDomain appdomain; + public string useLib = ""; System.IO.MemoryStream fs; System.IO.MemoryStream p; @@ -41,9 +42,9 @@ public class Performance : MonoBehaviour private void Awake() { - tests.Add("TestMandelbrot"); - tests.Add("Test0"); - tests.Add("Test1"); + tests.Add("TestMandelbrot float数值计算"); + tests.Add("Test0 transform set get pos"); + tests.Add("Test1 transform rotation"); tests.Add("Test2"); tests.Add("Test3"); tests.Add("Test4"); @@ -74,6 +75,8 @@ void CreateTestButton(string testName, GameObject go) btn.onClick.AddListener(() => { StringBuilder sb = new StringBuilder(); + sb.AppendLine(useLib); + sb.AppendLine(testName); #if UNITY_EDITOR || DEBUG sb.AppendLine("请打包工程至非Development Build,并安装到真机再测试,编辑器中性能差异巨大,当前测试结果不具备测试意义"); #endif @@ -94,7 +97,7 @@ public void LoadHotFixAssemblyStack() //首先实例化ILRuntime的AppDomain,AppDomain是一个应用程序域,每个AppDomain都是一个独立的沙盒 appdomain = new ILRuntime.Runtime.Enviorment.AppDomain(); StartCoroutine(LoadHotFixAssembly()); - + useLib = "ilrstack"; } public void LoadHotFixAssemblyRegister() @@ -103,6 +106,7 @@ public void LoadHotFixAssemblyRegister() //ILRuntimeJITFlags.JITImmediately表示默认使用寄存器VM执行所有方法 appdomain = new ILRuntime.Runtime.Enviorment.AppDomain(ILRuntimeJITFlags.JITImmediately); StartCoroutine(LoadHotFixAssembly()); + useLib = "ilrregister"; } public void LoadLua() @@ -116,6 +120,7 @@ public void LoadLua() Debug.LogError("请自行安装XLua并生成xlua绑定代码后,将performance.lua复制到StreamingAssets后,解除Performace.cs第一行注释"); #endif OnHotFixLoaded(); + useLib = "xlua"; } IEnumerator LoadHotFixAssembly() @@ -142,21 +147,23 @@ IEnumerator LoadHotFixAssembly() www.Dispose(); //PDB文件是调试数据库,如需要在日志中显示报错的行号,则必须提供PDB文件,不过由于会额外耗用内存,正式发布时请将PDB去掉,下面LoadAssembly的时候pdb传null即可 -#if UNITY_ANDROID - www = new WWW(Application.streamingAssetsPath + "/HotFix_Project.pdb"); -#else - www = new WWW("file:///" + Application.streamingAssetsPath + "/HotFix_Project.pdb"); -#endif - while (!www.isDone) - yield return null; - if (!string.IsNullOrEmpty(www.error)) - UnityEngine.Debug.LogError(www.error); - byte[] pdb = www.bytes; +//#if UNITY_ANDROID +// www = new WWW(Application.streamingAssetsPath + "/HotFix_Project.pdb"); +//#else +// www = new WWW("file:///" + Application.streamingAssetsPath + "/HotFix_Project.pdb"); +//#endif +// while (!www.isDone) +// yield return null; +// if (!string.IsNullOrEmpty(www.error)) +// UnityEngine.Debug.LogError(www.error); +// byte[] pdb = www.bytes; +// www.Dispose(); + fs = new MemoryStream(dll); - p = new MemoryStream(pdb); + //p = new MemoryStream(pdb); try { - appdomain.LoadAssembly(fs, p, new ILRuntime.Mono.Cecil.Pdb.PdbReaderProvider()); + appdomain.LoadAssembly(fs, null, new ILRuntime.Mono.Cecil.Pdb.PdbReaderProvider()); } catch { diff --git a/ILRuntimeDemo/Assets/StreamingAssets/performance.lua b/ILRuntimeDemo/Assets/StreamingAssets/performance.lua index 04e59a7..c8aa415 100644 --- a/ILRuntimeDemo/Assets/StreamingAssets/performance.lua +++ b/ILRuntimeDemo/Assets/StreamingAssets/performance.lua @@ -4,7 +4,55 @@ end local GameObject = CS.UnityEngine.GameObject local Vector3 = CS.UnityEngine.Vector3 local Quaternion = CS.UnityEngine.Quaternion +local CSMandelbrotCheck = CS.Performance.MandelbrotCheck + function TestMandelbrot(sb) + TestMandelbrot1(sb) + TestMandelbrot2(sb) +end + +function TestMandelbrot1(sb) + local data = 0.0 + local iterations = 4 + local width = 64 + local height = 64 + local _os_t = os.clock + local _ct = _os_t() + for i = 1, iterations do + local left = -2.1 + local right = 1.0 + local top = -1.3 + local bottom = 1.3 + local deltaX = (right - left) / width + local deltaY = (bottom - top) / height + local coordinateX = left + for x = 1, width do + local coordinateY = top + for y = 1, height do + local workX = 0 + local workY = 0 + local counter = 0 + while(counter < 255 and MandelbrotCheck(workX, workY)) + --while(counter < 255 and CSMandelbrotCheck(workX, workY)) + do + counter = counter + 1 + local newX = (workX * workX) - (workY * workY) + coordinateX + workY = 2 * workX * workY + coordinateY + workX = newX; + end + + data = workX + workY + coordinateY = coordinateY + deltaY + end + coordinateX = coordinateX + deltaX + end + end + local _d = _os_t() - _ct + sb:AppendLine("lua use self res="..data..", time:".._d*1000); +end + + +function TestMandelbrot2(sb) local data = 0.0 local iterations = 4 local width = 64 @@ -26,7 +74,7 @@ function TestMandelbrot(sb) local workY = 0 local counter = 0 --while(counter < 255 and MandelbrotCheck(workX, workY)) - while(counter < 255 and CS.Performance.MandelbrotCheck(workX, workY)) + while(counter < 255 and CSMandelbrotCheck(workX, workY)) do counter = counter + 1 local newX = (workX * workX) - (workY * workY) + coordinateX @@ -41,16 +89,19 @@ function TestMandelbrot(sb) end end local _d = _os_t() - _ct - sb:AppendLine("res="..data..", time:".._d*1000); + sb:AppendLine("lua use C# res="..data..", time:".._d*1000); end function Test0(sb) local t = os.clock() local go = GameObject("t") local transform = go.transform - + local x,y,z = 1 + for i = 1, 2000000 do - transform.position = transform.position + x,y,z = transform:GetPosition(x,y,z) + transform:SetPosition(x,y,z) + --transform.position = transform.position end GameObject.Destroy(go) sb:AppendLine("time="..(os.clock()-t)*1000) @@ -62,7 +113,8 @@ function Test1(sb) local transform = go.transform for i = 1, 2000000 do - transform:Rotate(Vector3.up, 1) + transform:Rotation(0, 1, 0, 1) + --transform:Rotate(Vector3.up, 1) end GameObject.Destroy(go) diff --git a/ILRuntimeDemo/Assets/XLua/Editor/ExampleConfig.cs b/ILRuntimeDemo/Assets/XLua/Editor/ExampleConfig.cs deleted file mode 100644 index 1c0d6d1..0000000 --- a/ILRuntimeDemo/Assets/XLua/Editor/ExampleConfig.cs +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making xLua available. - * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/ - -using System.Collections.Generic; -using System; -using XLua; -using System.Reflection; -using System.Linq; -using System.Text; - -//配置的详细介绍请看Doc下《XLua的配置.doc》 -public static class ExampleConfig -{ - /***************如果你全lua编程,可以参考这份自动化配置***************/ - //--------------begin 纯lua编程配置参考---------------------------- - static List exclude = new List { - "HideInInspector", "ExecuteInEditMode", - "AddComponentMenu", "ContextMenu", - "RequireComponent", "DisallowMultipleComponent", - "SerializeField", "AssemblyIsEditorAssembly", - "Attribute", "Types", - "UnitySurrogateSelector", "TrackedReference", - "TypeInferenceRules", "FFTWindow", - "RPC", "Network", "MasterServer", - "BitStream", "HostData", - "ConnectionTesterStatus", "GUI", "EventType", - "EventModifiers", "FontStyle", "TextAlignment", - "TextEditor", "TextEditorDblClickSnapping", - "TextGenerator", "TextClipping", "Gizmos", - "ADBannerView", "ADInterstitialAd", - "Android", "Tizen", "jvalue", - "iPhone", "iOS", "Windows", "CalendarIdentifier", - "CalendarUnit", "CalendarUnit", - "ClusterInput", "FullScreenMovieControlMode", - "FullScreenMovieScalingMode", "Handheld", - "LocalNotification", "NotificationServices", - "RemoteNotificationType", "RemoteNotification", - "SamsungTV", "TextureCompressionQuality", - "TouchScreenKeyboardType", "TouchScreenKeyboard", - "MovieTexture", "UnityEngineInternal","UnityEngine.MeshRenderer", - "Terrain", "Tree", "SplatPrototype","LightingSettings","DefaultControls","Graphic","Texture","Light","Text","ParticleSystem", - "DetailPrototype", "DetailRenderMode", - "MeshSubsetCombineUtility", "AOT", "Social", "Enumerator", - "SendMouseEvents", "Cursor", "Flash", "ActionScript", - "OnRequestRebuild", "Ping", - "ShaderVariantCollection", "SimpleJson.Reflection", - "CoroutineTween", "GraphicRebuildTracker", - "Advertisements", "UnityEditor", "WSA", - "EventProvider", "Apple","CanvasRenderer","AnimatorControllerParameter","AudioSettings","Caching","DrivenRect","LightProbeGroup", - "ClusterInput", "Motion", - "UnityEngine.UI.ReflectionMethodsCache", "NativeLeakDetection", - "NativeLeakDetectionMode", "WWWAudioExtensions", "UnityEngine.Experimental", - }; - - static bool isExcluded(Type type) - { - var fullName = type.FullName; - for (int i = 0; i < exclude.Count; i++) - { - if (fullName.Contains(exclude[i])) - { - return true; - } - } - return false; - } - - [LuaCallCSharp] - public static IEnumerable LuaCallCSharp - { - get - { - List namespaces = new List() // 在这里添加名字空间 - { - "UnityEngine", - "UnityEngine.UI" - }; - var unityTypes = (from assembly in AppDomain.CurrentDomain.GetAssemblies() - where !(assembly.ManifestModule is System.Reflection.Emit.ModuleBuilder) - from type in assembly.GetExportedTypes() - where type.Namespace != null && namespaces.Contains(type.Namespace) && !isExcluded(type) - && type.BaseType != typeof(MulticastDelegate) && !type.IsInterface && !type.IsEnum - select type); - - string[] customAssemblys = new string[] { - "Assembly-CSharp", - }; - var customTypes = (from assembly in customAssemblys.Select(s => Assembly.Load(s)) - from type in assembly.GetExportedTypes() - where type.Namespace == null || !type.Namespace.StartsWith("XLua") - && type.BaseType != typeof(MulticastDelegate) && !type.IsInterface && !type.IsEnum - select type).ToList(); - customTypes.Add(typeof(StringBuilder)); - return unityTypes.Concat(customTypes); - } - } - - ////自动把LuaCallCSharp涉及到的delegate加到CSharpCallLua列表,后续可以直接用lua函数做callback - [CSharpCallLua] - public static List CSharpCallLua - { - get - { - var lua_call_csharp = LuaCallCSharp; - var delegate_types = new List(); - var flag = BindingFlags.Public | BindingFlags.Instance - | BindingFlags.Static | BindingFlags.IgnoreCase | BindingFlags.DeclaredOnly; - foreach (var field in (from type in lua_call_csharp select type).SelectMany(type => type.GetFields(flag))) - { - if (typeof(Delegate).IsAssignableFrom(field.FieldType)) - { - delegate_types.Add(field.FieldType); - } - } - - foreach (var method in (from type in lua_call_csharp select type).SelectMany(type => type.GetMethods(flag))) - { - if (typeof(Delegate).IsAssignableFrom(method.ReturnType)) - { - delegate_types.Add(method.ReturnType); - } - foreach (var param in method.GetParameters()) - { - var paramType = param.ParameterType.IsByRef ? param.ParameterType.GetElementType() : param.ParameterType; - if (typeof(Delegate).IsAssignableFrom(paramType)) - { - delegate_types.Add(paramType); - } - } - } - return delegate_types.Where(t => t.BaseType == typeof(MulticastDelegate) && !hasGenericParameter(t) && !delegateHasEditorRef(t)).Distinct().ToList(); - } - } - //--------------end 纯lua编程配置参考---------------------------- - - /***************热补丁可以参考这份自动化配置***************/ - //[Hotfix] - //static IEnumerable HotfixInject - //{ - // get - // { - // return (from type in Assembly.Load("Assembly-CSharp").GetTypes() - // where type.Namespace == null || !type.Namespace.StartsWith("XLua") - // select type); - // } - //} - //--------------begin 热补丁自动化配置------------------------- - static bool hasGenericParameter(Type type) - { - if (type.IsGenericTypeDefinition) return true; - if (type.IsGenericParameter) return true; - if (type.IsByRef || type.IsArray) - { - return hasGenericParameter(type.GetElementType()); - } - if (type.IsGenericType) - { - foreach (var typeArg in type.GetGenericArguments()) - { - if (hasGenericParameter(typeArg)) - { - return true; - } - } - } - return false; - } - - static bool typeHasEditorRef(Type type) - { - if (type.Namespace != null && (type.Namespace == "UnityEditor" || type.Namespace.StartsWith("UnityEditor."))) - { - return true; - } - if (type.IsNested) - { - return typeHasEditorRef(type.DeclaringType); - } - if (type.IsByRef || type.IsArray) - { - return typeHasEditorRef(type.GetElementType()); - } - if (type.IsGenericType) - { - foreach (var typeArg in type.GetGenericArguments()) - { - if (typeHasEditorRef(typeArg)) - { - return true; - } - } - } - return false; - } - - static bool delegateHasEditorRef(Type delegateType) - { - if (typeHasEditorRef(delegateType)) return true; - var method = delegateType.GetMethod("Invoke"); - if (method == null) - { - return false; - } - if (typeHasEditorRef(method.ReturnType)) return true; - return method.GetParameters().Any(pinfo => typeHasEditorRef(pinfo.ParameterType)); - } - - // 配置某Assembly下所有涉及到的delegate到CSharpCallLua下,Hotfix下拿不准那些delegate需要适配到lua function可以这么配置 - //[CSharpCallLua] - //static IEnumerable AllDelegate - //{ - // get - // { - // BindingFlags flag = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public; - // List allTypes = new List(); - // var allAssemblys = new Assembly[] - // { - // Assembly.Load("Assembly-CSharp") - // }; - // foreach (var t in (from assembly in allAssemblys from type in assembly.GetTypes() select type)) - // { - // var p = t; - // while (p != null) - // { - // allTypes.Add(p); - // p = p.BaseType; - // } - // } - // allTypes = allTypes.Distinct().ToList(); - // var allMethods = from type in allTypes - // from method in type.GetMethods(flag) - // select method; - // var returnTypes = from method in allMethods - // select method.ReturnType; - // var paramTypes = allMethods.SelectMany(m => m.GetParameters()).Select(pinfo => pinfo.ParameterType.IsByRef ? pinfo.ParameterType.GetElementType() : pinfo.ParameterType); - // var fieldTypes = from type in allTypes - // from field in type.GetFields(flag) - // select field.FieldType; - // return (returnTypes.Concat(paramTypes).Concat(fieldTypes)).Where(t => t.BaseType == typeof(MulticastDelegate) && !hasGenericParameter(t) && !delegateHasEditorRef(t)).Distinct(); - // } - //} - //--------------end 热补丁自动化配置------------------------- - - //黑名单 - [BlackList] - public static List> BlackList = new List>() { - new List(){"System.Xml.XmlNodeList", "ItemOf"}, - new List(){"UnityEngine.WWW", "movie"}, - #if UNITY_WEBGL - new List(){"UnityEngine.WWW", "threadPriority"}, - #endif - new List(){"UnityEngine.Texture2D", "alphaIsTransparency"}, - new List(){"UnityEngine.Security", "GetChainOfTrustValue"}, - new List(){"UnityEngine.CanvasRenderer", "onRequestRebuild"}, - new List(){"UnityEngine.Light", "areaSize"}, - new List(){"UnityEngine.Light", "lightmapBakeType"}, - new List(){"UnityEngine.WWW", "MovieTexture"}, - new List(){"UnityEngine.WWW", "GetMovieTexture"}, - new List(){"UnityEngine.AnimatorOverrideController", "PerformOverrideClipListCleanup"}, - new List(){"UnityEngine.Input", "IsJoystickPreconfigured" }, - #if !UNITY_WEBPLAYER - new List(){"UnityEngine.Application", "ExternalEval"}, - #endif - new List(){"UnityEngine.GameObject", "networkView"}, //4.6.2 not support - new List(){"UnityEngine.Component", "networkView"}, //4.6.2 not support - new List(){"System.IO.FileInfo", "GetAccessControl", "System.Security.AccessControl.AccessControlSections"}, - new List(){"System.IO.FileInfo", "SetAccessControl", "System.Security.AccessControl.FileSecurity"}, - new List(){"System.IO.DirectoryInfo", "GetAccessControl", "System.Security.AccessControl.AccessControlSections"}, - new List(){"System.IO.DirectoryInfo", "SetAccessControl", "System.Security.AccessControl.DirectorySecurity"}, - new List(){"System.IO.DirectoryInfo", "CreateSubdirectory", "System.String", "System.Security.AccessControl.DirectorySecurity"}, - new List(){"System.IO.DirectoryInfo", "Create", "System.Security.AccessControl.DirectorySecurity"}, - new List(){"UnityEngine.MonoBehaviour", "runInEditMode"}, - }; - -#if UNITY_2018_1_OR_NEWER - [BlackList] - public static Func MethodFilter = (memberInfo) => - { - if (memberInfo.DeclaringType.IsGenericType && memberInfo.DeclaringType.GetGenericTypeDefinition() == typeof(Dictionary<,>)) - { - if (memberInfo.MemberType == MemberTypes.Constructor) - { - ConstructorInfo constructorInfo = memberInfo as ConstructorInfo; - var parameterInfos = constructorInfo.GetParameters(); - if (parameterInfos.Length > 0) - { - if (typeof(System.Collections.IEnumerable).IsAssignableFrom(parameterInfos[0].ParameterType)) - { - return true; - } - } - } - else if (memberInfo.MemberType == MemberTypes.Method) - { - var methodInfo = memberInfo as MethodInfo; - if (methodInfo.Name == "TryAdd" || methodInfo.Name == "Remove" && methodInfo.GetParameters().Length == 2) - { - return true; - } - } - } - return false; - }; -#endif -} diff --git a/ILRuntimeDemo/Assets/XLua/Examples/ExampleGenConfig.cs b/ILRuntimeDemo/Assets/XLua/Examples/ExampleGenConfig.cs index 049cc0f..e911c44 100644 --- a/ILRuntimeDemo/Assets/XLua/Examples/ExampleGenConfig.cs +++ b/ILRuntimeDemo/Assets/XLua/Examples/ExampleGenConfig.cs @@ -13,42 +13,44 @@ //using System.Reflection; //using System.Linq; +[LuaCallCSharp] +public static class TransformUtil +{ + public static void GetPosition(this Transform transform, out float x, out float y, out float z) + { + var pos = transform.position; + x = pos.x; + y = pos.y; + z = pos.z; + } + + public static void SetPosition(this Transform transform, float x, float y, float z) + { + transform.position = new Vector3(x, y, z); + } + + public static void Rotation(this Transform transform, float x, float y, float z) + { + transform.Rotate(new Vector3(x, y, z), 1); + } + +} + //配置的详细介绍请看Doc下《XLua的配置.doc》 public static class ExampleGenConfig { //lua中要使用到C#库的配置,比如C#标准库,或者Unity API,第三方库等。 [LuaCallCSharp] public static List LuaCallCSharp = new List() { - typeof(System.Object), - typeof(UnityEngine.Object), - typeof(Vector2), - typeof(Vector3), - typeof(Vector4), - typeof(Quaternion), - typeof(Color), - typeof(Ray), - typeof(Bounds), - typeof(Ray2D), - typeof(Time), typeof(GameObject), - typeof(Component), - typeof(Behaviour), typeof(Transform), - typeof(Resources), - typeof(TextAsset), - typeof(Keyframe), - typeof(AnimationCurve), - typeof(AnimationClip), - typeof(MonoBehaviour), - typeof(ParticleSystem), - typeof(SkinnedMeshRenderer), - typeof(Renderer), - typeof(WWW), - typeof(Light), - typeof(Mathf), - typeof(System.Collections.Generic.List), - typeof(Action), - typeof(UnityEngine.Debug) + }; + + [GCOptimize] + [LuaCallCSharp] + public static List GCSharp = new List() { + typeof(Vector3), + typeof(Quaternion), }; //C#静态调用Lua的配置(包括事件的原型),仅可以配delegate,interface diff --git a/ILRuntimeDemo/Assets/XLua/Gen/DelegatesGensBridge.cs b/ILRuntimeDemo/Assets/XLua/Gen/DelegatesGensBridge.cs new file mode 100644 index 0000000..b79cbb3 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/DelegatesGensBridge.cs @@ -0,0 +1,227 @@ +#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 System; + + +namespace XLua +{ + public partial class DelegateBridge : DelegateBridgeBase + { + + public void __Gen_Delegate_Imp0() + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.rawL; + int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); + + + PCall(L, 0, 0, errFunc); + + + + LuaAPI.lua_settop(L, errFunc - 1); + +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + public double __Gen_Delegate_Imp1(double p0, double p1) + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.rawL; + int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); + + LuaAPI.lua_pushnumber(L, p0); + LuaAPI.lua_pushnumber(L, p1); + + PCall(L, 2, 1, errFunc); + + + double __gen_ret = LuaAPI.lua_tonumber(L, errFunc + 1); + LuaAPI.lua_settop(L, errFunc - 1); + return __gen_ret; +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + public void __Gen_Delegate_Imp2(string p0) + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.rawL; + int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); + + LuaAPI.lua_pushstring(L, p0); + + PCall(L, 1, 0, errFunc); + + + + LuaAPI.lua_settop(L, errFunc - 1); + +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + public void __Gen_Delegate_Imp3(double p0) + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.rawL; + int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); + + LuaAPI.lua_pushnumber(L, p0); + + PCall(L, 1, 0, errFunc); + + + + LuaAPI.lua_settop(L, errFunc - 1); + +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + public void __Gen_Delegate_Imp4(System.Text.StringBuilder p0) + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.rawL; + int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); + ObjectTranslator translator = luaEnv.translator; + translator.Push(L, p0); + + PCall(L, 1, 0, errFunc); + + + + LuaAPI.lua_settop(L, errFunc - 1); + +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + public int __Gen_Delegate_Imp5(int p0, string p1, out Tutorial.CSCallLua.DClass p2) + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.rawL; + int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); + ObjectTranslator translator = luaEnv.translator; + LuaAPI.xlua_pushinteger(L, p0); + LuaAPI.lua_pushstring(L, p1); + + PCall(L, 2, 2, errFunc); + + p2 = (Tutorial.CSCallLua.DClass)translator.GetObject(L, errFunc + 2, typeof(Tutorial.CSCallLua.DClass)); + + int __gen_ret = LuaAPI.xlua_tointeger(L, errFunc + 1); + LuaAPI.lua_settop(L, errFunc - 1); + return __gen_ret; +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + public System.Action __Gen_Delegate_Imp6() + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.rawL; + int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference); + ObjectTranslator translator = luaEnv.translator; + + PCall(L, 0, 1, errFunc); + + + System.Action __gen_ret = translator.GetDelegate(L, errFunc + 1); + LuaAPI.lua_settop(L, errFunc - 1); + return __gen_ret; +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + + static DelegateBridge() + { + Gen_Flag = true; + } + + public override Delegate GetDelegateByType(Type type) + { + + if (type == typeof(System.Action)) + { + return new System.Action(__Gen_Delegate_Imp0); + } + + if (type == typeof(UnityEngine.Events.UnityAction)) + { + return new UnityEngine.Events.UnityAction(__Gen_Delegate_Imp0); + } + + if (type == typeof(System.Func)) + { + return new System.Func(__Gen_Delegate_Imp1); + } + + if (type == typeof(System.Action)) + { + return new System.Action(__Gen_Delegate_Imp2); + } + + if (type == typeof(System.Action)) + { + return new System.Action(__Gen_Delegate_Imp3); + } + + if (type == typeof(Performance.LuaCallPerfCase)) + { + return new Performance.LuaCallPerfCase(__Gen_Delegate_Imp4); + } + + if (type == typeof(Tutorial.CSCallLua.FDelegate)) + { + return new Tutorial.CSCallLua.FDelegate(__Gen_Delegate_Imp5); + } + + if (type == typeof(Tutorial.CSCallLua.GetE)) + { + return new Tutorial.CSCallLua.GetE(__Gen_Delegate_Imp6); + } + + return null; + } + } + +} \ No newline at end of file diff --git a/ILRuntimeDemo/Assets/ILRuntime/Samples~/Basic Demo/Editor/ILRuntimeCrossBinding.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/DelegatesGensBridge.cs.meta similarity index 83% rename from ILRuntimeDemo/Assets/ILRuntime/Samples~/Basic Demo/Editor/ILRuntimeCrossBinding.cs.meta rename to ILRuntimeDemo/Assets/XLua/Gen/DelegatesGensBridge.cs.meta index 4d12712..eb85df9 100644 --- a/ILRuntimeDemo/Assets/ILRuntime/Samples~/Basic Demo/Editor/ILRuntimeCrossBinding.cs.meta +++ b/ILRuntimeDemo/Assets/XLua/Gen/DelegatesGensBridge.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8c7a8312d4408db4d90df8cf627e124b +guid: b819cdc3f61f2f44f944aff34ae0a3f1 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/ILRuntimeDemo/Assets/XLua/Gen/EnumWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/EnumWrap.cs new file mode 100644 index 0000000..7c0b6a7 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/EnumWrap.cs @@ -0,0 +1,135 @@ +#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 TutorialTestEnumWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + Utils.BeginObjectRegister(typeof(Tutorial.TestEnum), L, translator, 0, 0, 0, 0); + Utils.EndObjectRegister(typeof(Tutorial.TestEnum), L, translator, null, null, null, null, null); + + Utils.BeginClassRegister(typeof(Tutorial.TestEnum), L, null, 3, 0, 0); + + + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "E1", Tutorial.TestEnum.E1); + + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "E2", Tutorial.TestEnum.E2); + + + Utils.RegisterFunc(L, Utils.CLS_IDX, "__CastFrom", __CastFrom); + + Utils.EndClassRegister(typeof(Tutorial.TestEnum), L, translator); + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __CastFrom(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + LuaTypes lua_type = LuaAPI.lua_type(L, 1); + if (lua_type == LuaTypes.LUA_TNUMBER) + { + translator.PushTutorialTestEnum(L, (Tutorial.TestEnum)LuaAPI.xlua_tointeger(L, 1)); + } + + else if(lua_type == LuaTypes.LUA_TSTRING) + { + + if (LuaAPI.xlua_is_eq_str(L, 1, "E1")) + { + translator.PushTutorialTestEnum(L, Tutorial.TestEnum.E1); + } + else if (LuaAPI.xlua_is_eq_str(L, 1, "E2")) + { + translator.PushTutorialTestEnum(L, Tutorial.TestEnum.E2); + } + else + { + return LuaAPI.luaL_error(L, "invalid string for Tutorial.TestEnum!"); + } + + } + + else + { + return LuaAPI.luaL_error(L, "invalid lua type for Tutorial.TestEnum! Expect number or string, got + " + lua_type); + } + + return 1; + } + } + + public class TutorialDerivedClassTestEnumInnerWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + Utils.BeginObjectRegister(typeof(Tutorial.DerivedClass.TestEnumInner), L, translator, 0, 0, 0, 0); + Utils.EndObjectRegister(typeof(Tutorial.DerivedClass.TestEnumInner), L, translator, null, null, null, null, null); + + Utils.BeginClassRegister(typeof(Tutorial.DerivedClass.TestEnumInner), L, null, 3, 0, 0); + + + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "E3", Tutorial.DerivedClass.TestEnumInner.E3); + + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "E4", Tutorial.DerivedClass.TestEnumInner.E4); + + + Utils.RegisterFunc(L, Utils.CLS_IDX, "__CastFrom", __CastFrom); + + Utils.EndClassRegister(typeof(Tutorial.DerivedClass.TestEnumInner), L, translator); + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __CastFrom(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + LuaTypes lua_type = LuaAPI.lua_type(L, 1); + if (lua_type == LuaTypes.LUA_TNUMBER) + { + translator.PushTutorialDerivedClassTestEnumInner(L, (Tutorial.DerivedClass.TestEnumInner)LuaAPI.xlua_tointeger(L, 1)); + } + + else if(lua_type == LuaTypes.LUA_TSTRING) + { + + if (LuaAPI.xlua_is_eq_str(L, 1, "E3")) + { + translator.PushTutorialDerivedClassTestEnumInner(L, Tutorial.DerivedClass.TestEnumInner.E3); + } + else if (LuaAPI.xlua_is_eq_str(L, 1, "E4")) + { + translator.PushTutorialDerivedClassTestEnumInner(L, Tutorial.DerivedClass.TestEnumInner.E4); + } + else + { + return LuaAPI.luaL_error(L, "invalid string for Tutorial.DerivedClass.TestEnumInner!"); + } + + } + + else + { + return LuaAPI.luaL_error(L, "invalid lua type for Tutorial.DerivedClass.TestEnumInner! Expect number or string, got + " + lua_type); + } + + return 1; + } + } + +} \ No newline at end of file diff --git a/ILRuntimeDemo/Assets/ILRuntime/Samples~/Basic Demo/Editor/ILRuntimeMenu.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/EnumWrap.cs.meta similarity index 83% rename from ILRuntimeDemo/Assets/ILRuntime/Samples~/Basic Demo/Editor/ILRuntimeMenu.cs.meta rename to ILRuntimeDemo/Assets/XLua/Gen/EnumWrap.cs.meta index 38d4c7b..979a478 100644 --- a/ILRuntimeDemo/Assets/ILRuntime/Samples~/Basic Demo/Editor/ILRuntimeMenu.cs.meta +++ b/ILRuntimeDemo/Assets/XLua/Gen/EnumWrap.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3bc9b09d590588549b0d1efc0936274c +guid: 786c39ceff55c5a43bfeb0a009b330f3 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/ILRuntimeDemo/Assets/XLua/Gen/PackUnpack.cs b/ILRuntimeDemo/Assets/XLua/Gen/PackUnpack.cs new file mode 100644 index 0000000..08af952 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/PackUnpack.cs @@ -0,0 +1,542 @@ +#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 System; + + +namespace XLua +{ + public static partial class CopyByValue + { + + + public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Vector3 val) + { + val = new UnityEngine.Vector3(); + int top = LuaAPI.lua_gettop(L); + + if (Utils.LoadField(L, idx, "x")) + { + + translator.Get(L, top + 1, out val.x); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "y")) + { + + translator.Get(L, top + 1, out val.y); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "z")) + { + + translator.Get(L, top + 1, out val.z); + + } + LuaAPI.lua_pop(L, 1); + + } + + public static bool Pack(IntPtr buff, int offset, UnityEngine.Vector3 field) + { + + if(!LuaAPI.xlua_pack_float3(buff, offset, field.x, field.y, field.z)) + { + return false; + } + + return true; + } + public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Vector3 field) + { + field = default(UnityEngine.Vector3); + + float x = default(float); + float y = default(float); + float z = default(float); + + if(!LuaAPI.xlua_unpack_float3(buff, offset, out x, out y, out z)) + { + return false; + } + field.x = x; + field.y = y; + field.z = z; + + + return true; + } + + + public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Quaternion val) + { + val = new UnityEngine.Quaternion(); + int top = LuaAPI.lua_gettop(L); + + if (Utils.LoadField(L, idx, "x")) + { + + translator.Get(L, top + 1, out val.x); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "y")) + { + + translator.Get(L, top + 1, out val.y); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "z")) + { + + translator.Get(L, top + 1, out val.z); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "w")) + { + + translator.Get(L, top + 1, out val.w); + + } + LuaAPI.lua_pop(L, 1); + + } + + public static bool Pack(IntPtr buff, int offset, UnityEngine.Quaternion field) + { + + if(!LuaAPI.xlua_pack_float4(buff, offset, field.x, field.y, field.z, field.w)) + { + return false; + } + + return true; + } + public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Quaternion field) + { + field = default(UnityEngine.Quaternion); + + float x = default(float); + float y = default(float); + float z = default(float); + float w = default(float); + + if(!LuaAPI.xlua_unpack_float4(buff, offset, out x, out y, out z, out w)) + { + return false; + } + field.x = x; + field.y = y; + field.z = z; + field.w = w; + + + return true; + } + + + public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Vector2 val) + { + val = new UnityEngine.Vector2(); + int top = LuaAPI.lua_gettop(L); + + if (Utils.LoadField(L, idx, "x")) + { + + translator.Get(L, top + 1, out val.x); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "y")) + { + + translator.Get(L, top + 1, out val.y); + + } + LuaAPI.lua_pop(L, 1); + + } + + public static bool Pack(IntPtr buff, int offset, UnityEngine.Vector2 field) + { + + if(!LuaAPI.xlua_pack_float2(buff, offset, field.x, field.y)) + { + return false; + } + + return true; + } + public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Vector2 field) + { + field = default(UnityEngine.Vector2); + + float x = default(float); + float y = default(float); + + if(!LuaAPI.xlua_unpack_float2(buff, offset, out x, out y)) + { + return false; + } + field.x = x; + field.y = y; + + + return true; + } + + + public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Vector4 val) + { + val = new UnityEngine.Vector4(); + int top = LuaAPI.lua_gettop(L); + + if (Utils.LoadField(L, idx, "x")) + { + + translator.Get(L, top + 1, out val.x); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "y")) + { + + translator.Get(L, top + 1, out val.y); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "z")) + { + + translator.Get(L, top + 1, out val.z); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "w")) + { + + translator.Get(L, top + 1, out val.w); + + } + LuaAPI.lua_pop(L, 1); + + } + + public static bool Pack(IntPtr buff, int offset, UnityEngine.Vector4 field) + { + + if(!LuaAPI.xlua_pack_float4(buff, offset, field.x, field.y, field.z, field.w)) + { + return false; + } + + return true; + } + public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Vector4 field) + { + field = default(UnityEngine.Vector4); + + float x = default(float); + float y = default(float); + float z = default(float); + float w = default(float); + + if(!LuaAPI.xlua_unpack_float4(buff, offset, out x, out y, out z, out w)) + { + return false; + } + field.x = x; + field.y = y; + field.z = z; + field.w = w; + + + return true; + } + + + public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Color val) + { + val = new UnityEngine.Color(); + int top = LuaAPI.lua_gettop(L); + + if (Utils.LoadField(L, idx, "r")) + { + + translator.Get(L, top + 1, out val.r); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "g")) + { + + translator.Get(L, top + 1, out val.g); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "b")) + { + + translator.Get(L, top + 1, out val.b); + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "a")) + { + + translator.Get(L, top + 1, out val.a); + + } + LuaAPI.lua_pop(L, 1); + + } + + public static bool Pack(IntPtr buff, int offset, UnityEngine.Color field) + { + + if(!LuaAPI.xlua_pack_float4(buff, offset, field.r, field.g, field.b, field.a)) + { + return false; + } + + return true; + } + public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Color field) + { + field = default(UnityEngine.Color); + + float r = default(float); + float g = default(float); + float b = default(float); + float a = default(float); + + if(!LuaAPI.xlua_unpack_float4(buff, offset, out r, out g, out b, out a)) + { + return false; + } + field.r = r; + field.g = g; + field.b = b; + field.a = a; + + + return true; + } + + + public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Ray val) + { + val = new UnityEngine.Ray(); + int top = LuaAPI.lua_gettop(L); + + if (Utils.LoadField(L, idx, "origin")) + { + + var origin = val.origin; + translator.Get(L, top + 1, out origin); + val.origin = origin; + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "direction")) + { + + var direction = val.direction; + translator.Get(L, top + 1, out direction); + val.direction = direction; + + } + LuaAPI.lua_pop(L, 1); + + } + + public static bool Pack(IntPtr buff, int offset, UnityEngine.Ray field) + { + + if(!Pack(buff, offset, field.origin)) + { + return false; + } + + if(!Pack(buff, offset + 12, field.direction)) + { + return false; + } + + return true; + } + public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Ray field) + { + field = default(UnityEngine.Ray); + + var origin = field.origin; + if(!UnPack(buff, offset, out origin)) + { + return false; + } + field.origin = origin; + + var direction = field.direction; + if(!UnPack(buff, offset + 12, out direction)) + { + return false; + } + field.direction = direction; + + return true; + } + + + public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Bounds val) + { + val = new UnityEngine.Bounds(); + int top = LuaAPI.lua_gettop(L); + + if (Utils.LoadField(L, idx, "center")) + { + + var center = val.center; + translator.Get(L, top + 1, out center); + val.center = center; + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "extents")) + { + + var extents = val.extents; + translator.Get(L, top + 1, out extents); + val.extents = extents; + + } + LuaAPI.lua_pop(L, 1); + + } + + public static bool Pack(IntPtr buff, int offset, UnityEngine.Bounds field) + { + + if(!Pack(buff, offset, field.center)) + { + return false; + } + + if(!Pack(buff, offset + 12, field.extents)) + { + return false; + } + + return true; + } + public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Bounds field) + { + field = default(UnityEngine.Bounds); + + var center = field.center; + if(!UnPack(buff, offset, out center)) + { + return false; + } + field.center = center; + + var extents = field.extents; + if(!UnPack(buff, offset + 12, out extents)) + { + return false; + } + field.extents = extents; + + return true; + } + + + public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Ray2D val) + { + val = new UnityEngine.Ray2D(); + int top = LuaAPI.lua_gettop(L); + + if (Utils.LoadField(L, idx, "origin")) + { + + var origin = val.origin; + translator.Get(L, top + 1, out origin); + val.origin = origin; + + } + LuaAPI.lua_pop(L, 1); + + if (Utils.LoadField(L, idx, "direction")) + { + + var direction = val.direction; + translator.Get(L, top + 1, out direction); + val.direction = direction; + + } + LuaAPI.lua_pop(L, 1); + + } + + public static bool Pack(IntPtr buff, int offset, UnityEngine.Ray2D field) + { + + if(!Pack(buff, offset, field.origin)) + { + return false; + } + + if(!Pack(buff, offset + 8, field.direction)) + { + return false; + } + + return true; + } + public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Ray2D field) + { + field = default(UnityEngine.Ray2D); + + var origin = field.origin; + if(!UnPack(buff, offset, out origin)) + { + return false; + } + field.origin = origin; + + var direction = field.direction; + if(!UnPack(buff, offset + 8, out direction)) + { + return false; + } + field.direction = direction; + + return true; + } + + } +} \ No newline at end of file diff --git a/ILRuntimeDemo/Assets/XLua/Editor/ExampleConfig.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/PackUnpack.cs.meta similarity index 71% rename from ILRuntimeDemo/Assets/XLua/Editor/ExampleConfig.cs.meta rename to ILRuntimeDemo/Assets/XLua/Gen/PackUnpack.cs.meta index 9913b66..5715cca 100644 --- a/ILRuntimeDemo/Assets/XLua/Editor/ExampleConfig.cs.meta +++ b/ILRuntimeDemo/Assets/XLua/Gen/PackUnpack.cs.meta @@ -1,7 +1,5 @@ fileFormatVersion: 2 -guid: 1b852d3c62124624888d03e611f7b1fc -timeCreated: 1534126175 -licenseType: Pro +guid: 040939166ed164f4cbb17f4cfccdcd88 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/ILRuntimeDemo/Assets/XLua/Gen/PerformanceWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/PerformanceWrap.cs new file mode 100644 index 0000000..54f6f53 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/PerformanceWrap.cs @@ -0,0 +1,469 @@ +#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 PerformanceWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(Performance); + Utils.BeginObjectRegister(type, L, translator, 0, 4, 7, 7); + + Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadHotFixAssemblyStack", _m_LoadHotFixAssemblyStack); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadHotFixAssemblyRegister", _m_LoadHotFixAssemblyRegister); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadLua", _m_LoadLua); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Unload", _m_Unload); + + + Utils.RegisterFunc(L, Utils.GETTER_IDX, "btnLoadStack", _g_get_btnLoadStack); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "btnLoadRegister", _g_get_btnLoadRegister); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "btnUnload", _g_get_btnUnload); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "panelTest", _g_get_panelTest); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "panelButton", _g_get_panelButton); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "lbResult", _g_get_lbResult); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "useLib", _g_get_useLib); + + Utils.RegisterFunc(L, Utils.SETTER_IDX, "btnLoadStack", _s_set_btnLoadStack); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "btnLoadRegister", _s_set_btnLoadRegister); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "btnUnload", _s_set_btnUnload); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "panelTest", _s_set_panelTest); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "panelButton", _s_set_panelButton); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "lbResult", _s_set_lbResult); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "useLib", _s_set_useLib); + + + Utils.EndObjectRegister(type, L, translator, null, null, + null, null, null); + + Utils.BeginClassRegister(type, L, __CreateInstance, 3, 0, 0); + Utils.RegisterFunc(L, Utils.CLS_IDX, "MandelbrotCheck", _m_MandelbrotCheck_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "TestFunc1", _m_TestFunc1_xlua_st_); + + + + + + + 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 Performance(); + 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 Performance constructor!"); + + } + + + + + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_LoadHotFixAssemblyStack(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.LoadHotFixAssemblyStack( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_LoadHotFixAssemblyRegister(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.LoadHotFixAssemblyRegister( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_LoadLua(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.LoadLua( ); + + + + 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 { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Performance gen_to_be_invoked = (Performance)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 _m_MandelbrotCheck_xlua_st_(RealStatePtr L) + { + try { + + + + + { + float _workX = (float)LuaAPI.lua_tonumber(L, 1); + float _workY = (float)LuaAPI.lua_tonumber(L, 2); + + var gen_ret = Performance.MandelbrotCheck( _workX, _workY ); + LuaAPI.lua_pushboolean(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_TestFunc1_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + int _a = LuaAPI.xlua_tointeger(L, 1); + string _b = LuaAPI.lua_tostring(L, 2); + UnityEngine.Transform _d = (UnityEngine.Transform)translator.GetObject(L, 3, typeof(UnityEngine.Transform)); + + Performance.TestFunc1( _a, _b, _d ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_btnLoadStack(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.btnLoadStack); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_btnLoadRegister(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.btnLoadRegister); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_btnUnload(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.btnUnload); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_panelTest(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.panelTest); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_panelButton(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.panelButton); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_lbResult(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.lbResult); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_useLib(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + LuaAPI.lua_pushstring(L, gen_to_be_invoked.useLib); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_btnLoadStack(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.btnLoadStack = (UnityEngine.UI.Button)translator.GetObject(L, 2, typeof(UnityEngine.UI.Button)); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_btnLoadRegister(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.btnLoadRegister = (UnityEngine.UI.Button)translator.GetObject(L, 2, typeof(UnityEngine.UI.Button)); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_btnUnload(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.btnUnload = (UnityEngine.UI.Button)translator.GetObject(L, 2, typeof(UnityEngine.UI.Button)); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_panelTest(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.panelTest = (UnityEngine.CanvasGroup)translator.GetObject(L, 2, typeof(UnityEngine.CanvasGroup)); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_panelButton(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.panelButton = (UnityEngine.RectTransform)translator.GetObject(L, 2, typeof(UnityEngine.RectTransform)); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_lbResult(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.lbResult = (UnityEngine.UI.Text)translator.GetObject(L, 2, typeof(UnityEngine.UI.Text)); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_useLib(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Performance gen_to_be_invoked = (Performance)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.useLib = LuaAPI.lua_tostring(L, 2); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Examples/13_BuildFromCLI/Editor/BuildFromCLI.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/PerformanceWrap.cs.meta similarity index 71% rename from ILRuntimeDemo/Assets/XLua/Examples/13_BuildFromCLI/Editor/BuildFromCLI.cs.meta rename to ILRuntimeDemo/Assets/XLua/Gen/PerformanceWrap.cs.meta index 2ae9dd4..2514f7e 100644 --- a/ILRuntimeDemo/Assets/XLua/Examples/13_BuildFromCLI/Editor/BuildFromCLI.cs.meta +++ b/ILRuntimeDemo/Assets/XLua/Gen/PerformanceWrap.cs.meta @@ -1,7 +1,5 @@ fileFormatVersion: 2 -guid: 1fd3fcc7509943c45af11f63df13d137 -timeCreated: 1531790057 -licenseType: Free +guid: d2b6e0bf8f36ecb4ab2d0ac9573c231e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/ILRuntimeDemo/Assets/XLua/Gen/System_Collections_IEnumeratorBridge.cs b/ILRuntimeDemo/Assets/XLua/Gen/System_Collections_IEnumeratorBridge.cs new file mode 100644 index 0000000..d370b86 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/System_Collections_IEnumeratorBridge.cs @@ -0,0 +1,139 @@ +#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; + + +namespace XLua.CSObjectWrap +{ + public class SystemCollectionsIEnumeratorBridge : LuaBase, System.Collections.IEnumerator + { + public static LuaBase __Create(int reference, LuaEnv luaenv) + { + return new SystemCollectionsIEnumeratorBridge(reference, luaenv); + } + + public SystemCollectionsIEnumeratorBridge(int reference, LuaEnv luaenv) : base(reference, luaenv) + { + } + + + bool System.Collections.IEnumerator.MoveNext() + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.L; + int err_func = LuaAPI.load_error_func(L, luaEnv.errorFuncRef); + + + LuaAPI.lua_getref(L, luaReference); + LuaAPI.xlua_pushasciistring(L, "MoveNext"); + if (0 != LuaAPI.xlua_pgettable(L, -2)) + { + luaEnv.ThrowExceptionFromError(err_func - 1); + } + if(!LuaAPI.lua_isfunction(L, -1)) + { + LuaAPI.xlua_pushasciistring(L, "no such function MoveNext"); + luaEnv.ThrowExceptionFromError(err_func - 1); + } + LuaAPI.lua_pushvalue(L, -2); + LuaAPI.lua_remove(L, -3); + + int __gen_error = LuaAPI.lua_pcall(L, 1, 1, err_func); + if (__gen_error != 0) + luaEnv.ThrowExceptionFromError(err_func - 1); + + + bool __gen_ret = LuaAPI.lua_toboolean(L, err_func + 1); + LuaAPI.lua_settop(L, err_func - 1); + return __gen_ret; +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + void System.Collections.IEnumerator.Reset() + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.L; + int err_func = LuaAPI.load_error_func(L, luaEnv.errorFuncRef); + + + LuaAPI.lua_getref(L, luaReference); + LuaAPI.xlua_pushasciistring(L, "Reset"); + if (0 != LuaAPI.xlua_pgettable(L, -2)) + { + luaEnv.ThrowExceptionFromError(err_func - 1); + } + if(!LuaAPI.lua_isfunction(L, -1)) + { + LuaAPI.xlua_pushasciistring(L, "no such function Reset"); + luaEnv.ThrowExceptionFromError(err_func - 1); + } + LuaAPI.lua_pushvalue(L, -2); + LuaAPI.lua_remove(L, -3); + + int __gen_error = LuaAPI.lua_pcall(L, 1, 0, err_func); + if (__gen_error != 0) + luaEnv.ThrowExceptionFromError(err_func - 1); + + + + LuaAPI.lua_settop(L, err_func - 1); + +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + + + object System.Collections.IEnumerator.Current + { + + get + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.L; + int oldTop = LuaAPI.lua_gettop(L); + ObjectTranslator translator = luaEnv.translator; + LuaAPI.lua_getref(L, luaReference); + LuaAPI.xlua_pushasciistring(L, "Current"); + if (0 != LuaAPI.xlua_pgettable(L, -2)) + { + luaEnv.ThrowExceptionFromError(oldTop); + } + object __gen_ret = translator.GetObject(L, -1, typeof(object)); + LuaAPI.lua_pop(L, 2); + return __gen_ret; +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + + } + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/System_Collections_IEnumeratorBridge.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/System_Collections_IEnumeratorBridge.cs.meta new file mode 100644 index 0000000..e268a05 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/System_Collections_IEnumeratorBridge.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5f88e7064a00d284fb9e5a8a1a4bcd9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/TransformUtilWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/TransformUtilWrap.cs new file mode 100644 index 0000000..9d8652f --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/TransformUtilWrap.cs @@ -0,0 +1,67 @@ +#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 TransformUtilWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(TransformUtil); + Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0); + + + + + + + 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) + { + return LuaAPI.luaL_error(L, "TransformUtil does not have a constructor!"); + } + + + + + + + + + + + + + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/TransformUtilWrap.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/TransformUtilWrap.cs.meta new file mode 100644 index 0000000..38e1894 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/TransformUtilWrap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cfc34d6c51151764faebdf874762dc6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_BaseClassWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_BaseClassWrap.cs new file mode 100644 index 0000000..f66b34e --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_BaseClassWrap.cs @@ -0,0 +1,223 @@ +#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; +using Tutorial; + +namespace XLua.CSObjectWrap +{ + using Utils = XLua.Utils; + public class TutorialBaseClassWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(Tutorial.BaseClass); + Utils.BeginObjectRegister(type, L, translator, 0, 2, 1, 1); + + Utils.RegisterFunc(L, Utils.METHOD_IDX, "BMFunc", _m_BMFunc); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSomeBaseData", _m_GetSomeBaseData); + + + Utils.RegisterFunc(L, Utils.GETTER_IDX, "BMF", _g_get_BMF); + + Utils.RegisterFunc(L, Utils.SETTER_IDX, "BMF", _s_set_BMF); + + + Utils.EndObjectRegister(type, L, translator, null, null, + null, null, null); + + Utils.BeginClassRegister(type, L, __CreateInstance, 2, 1, 1); + Utils.RegisterFunc(L, Utils.CLS_IDX, "BSFunc", _m_BSFunc_xlua_st_); + + + + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "BSF", _g_get_BSF); + + Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "BSF", _s_set_BSF); + + + 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 Tutorial.BaseClass(); + 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 Tutorial.BaseClass constructor!"); + + } + + + + + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_BSFunc_xlua_st_(RealStatePtr L) + { + try { + + + + + { + + Tutorial.BaseClass.BSFunc( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_BMFunc(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.BaseClass gen_to_be_invoked = (Tutorial.BaseClass)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.BMFunc( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetSomeBaseData(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.BaseClass gen_to_be_invoked = (Tutorial.BaseClass)translator.FastGetCSObj(L, 1); + + + + { + + var gen_ret = gen_to_be_invoked.GetSomeBaseData( ); + LuaAPI.xlua_pushinteger(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_BMF(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Tutorial.BaseClass gen_to_be_invoked = (Tutorial.BaseClass)translator.FastGetCSObj(L, 1); + LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.BMF); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_BSF(RealStatePtr L) + { + try { + + LuaAPI.xlua_pushinteger(L, Tutorial.BaseClass.BSF); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_BMF(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Tutorial.BaseClass gen_to_be_invoked = (Tutorial.BaseClass)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.BMF = LuaAPI.xlua_tointeger(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_BSF(RealStatePtr L) + { + try { + + Tutorial.BaseClass.BSF = LuaAPI.xlua_tointeger(L, 1); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_BaseClassWrap.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_BaseClassWrap.cs.meta new file mode 100644 index 0000000..6c013a7 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_BaseClassWrap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d6b8bd48c75f2f84bbba476dbb8a94ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_CSCallLua_ItfDBridge.cs b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_CSCallLua_ItfDBridge.cs new file mode 100644 index 0000000..7eeac7b --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_CSCallLua_ItfDBridge.cs @@ -0,0 +1,177 @@ +#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; + + +namespace XLua.CSObjectWrap +{ + public class TutorialCSCallLuaItfDBridge : LuaBase, Tutorial.CSCallLua.ItfD + { + public static LuaBase __Create(int reference, LuaEnv luaenv) + { + return new TutorialCSCallLuaItfDBridge(reference, luaenv); + } + + public TutorialCSCallLuaItfDBridge(int reference, LuaEnv luaenv) : base(reference, luaenv) + { + } + + + int Tutorial.CSCallLua.ItfD.add(int a, int b) + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.L; + int err_func = LuaAPI.load_error_func(L, luaEnv.errorFuncRef); + + + LuaAPI.lua_getref(L, luaReference); + LuaAPI.xlua_pushasciistring(L, "add"); + if (0 != LuaAPI.xlua_pgettable(L, -2)) + { + luaEnv.ThrowExceptionFromError(err_func - 1); + } + if(!LuaAPI.lua_isfunction(L, -1)) + { + LuaAPI.xlua_pushasciistring(L, "no such function add"); + luaEnv.ThrowExceptionFromError(err_func - 1); + } + LuaAPI.lua_pushvalue(L, -2); + LuaAPI.lua_remove(L, -3); + LuaAPI.xlua_pushinteger(L, a); + LuaAPI.xlua_pushinteger(L, b); + + int __gen_error = LuaAPI.lua_pcall(L, 3, 1, err_func); + if (__gen_error != 0) + luaEnv.ThrowExceptionFromError(err_func - 1); + + + int __gen_ret = LuaAPI.xlua_tointeger(L, err_func + 1); + LuaAPI.lua_settop(L, err_func - 1); + return __gen_ret; +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + + + int Tutorial.CSCallLua.ItfD.f1 + { + + get + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.L; + int oldTop = LuaAPI.lua_gettop(L); + + LuaAPI.lua_getref(L, luaReference); + LuaAPI.xlua_pushasciistring(L, "f1"); + if (0 != LuaAPI.xlua_pgettable(L, -2)) + { + luaEnv.ThrowExceptionFromError(oldTop); + } + int __gen_ret = LuaAPI.xlua_tointeger(L, -1); + LuaAPI.lua_pop(L, 2); + return __gen_ret; +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + + set + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.L; + int oldTop = LuaAPI.lua_gettop(L); + + LuaAPI.lua_getref(L, luaReference); + LuaAPI.xlua_pushasciistring(L, "f1"); + LuaAPI.xlua_pushinteger(L, value); + if (0 != LuaAPI.xlua_psettable(L, -3)) + { + luaEnv.ThrowExceptionFromError(oldTop); + } + LuaAPI.lua_pop(L, 1); +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + } + + int Tutorial.CSCallLua.ItfD.f2 + { + + get + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.L; + int oldTop = LuaAPI.lua_gettop(L); + + LuaAPI.lua_getref(L, luaReference); + LuaAPI.xlua_pushasciistring(L, "f2"); + if (0 != LuaAPI.xlua_pgettable(L, -2)) + { + luaEnv.ThrowExceptionFromError(oldTop); + } + int __gen_ret = LuaAPI.xlua_tointeger(L, -1); + LuaAPI.lua_pop(L, 2); + return __gen_ret; +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + + set + { +#if THREAD_SAFE || HOTFIX_ENABLE + lock (luaEnv.luaEnvLock) + { +#endif + RealStatePtr L = luaEnv.L; + int oldTop = LuaAPI.lua_gettop(L); + + LuaAPI.lua_getref(L, luaReference); + LuaAPI.xlua_pushasciistring(L, "f2"); + LuaAPI.xlua_pushinteger(L, value); + if (0 != LuaAPI.xlua_psettable(L, -3)) + { + luaEnv.ThrowExceptionFromError(oldTop); + } + LuaAPI.lua_pop(L, 1); +#if THREAD_SAFE || HOTFIX_ENABLE + } +#endif + } + + } + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_CSCallLua_ItfDBridge.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_CSCallLua_ItfDBridge.cs.meta new file mode 100644 index 0000000..523a1c6 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_CSCallLua_ItfDBridge.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: abd2665cab275e44cbee7f93d18e1c30 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassExtensionsWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassExtensionsWrap.cs new file mode 100644 index 0000000..4a08374 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassExtensionsWrap.cs @@ -0,0 +1,67 @@ +#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 TutorialDerivedClassExtensionsWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(Tutorial.DerivedClassExtensions); + Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0); + + + + + + + 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) + { + return LuaAPI.luaL_error(L, "Tutorial.DerivedClassExtensions does not have a constructor!"); + } + + + + + + + + + + + + + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassExtensionsWrap.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassExtensionsWrap.cs.meta new file mode 100644 index 0000000..8f9f03a --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassExtensionsWrap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 906ca4dceb276054fa8e4d807ce0139a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassWrap.cs new file mode 100644 index 0000000..a0dd2eb --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassWrap.cs @@ -0,0 +1,588 @@ +#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; +using Tutorial; + +namespace XLua.CSObjectWrap +{ + using Utils = XLua.Utils; + public class TutorialDerivedClassWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(Tutorial.DerivedClass); + Utils.BeginObjectRegister(type, L, translator, 1, 12, 2, 2); + Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__add", __AddMeta); + + Utils.RegisterFunc(L, Utils.METHOD_IDX, "DMFunc", _m_DMFunc); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "ComplexFunc", _m_ComplexFunc); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "TestFunc", _m_TestFunc); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "DefaultValueFunc", _m_DefaultValueFunc); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "VariableParamsFunc", _m_VariableParamsFunc); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "EnumTestFunc", _m_EnumTestFunc); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "CallEvent", _m_CallEvent); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "TestLong", _m_TestLong); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetCalc", _m_GetCalc); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSomeData", _m_GetSomeData); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GenericMethodOfString", _m_GenericMethodOfString); + + Utils.RegisterFunc(L, Utils.METHOD_IDX, "TestEvent", _e_TestEvent); + + Utils.RegisterFunc(L, Utils.GETTER_IDX, "DMF", _g_get_DMF); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "TestDelegate", _g_get_TestDelegate); + + Utils.RegisterFunc(L, Utils.SETTER_IDX, "DMF", _s_set_DMF); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "TestDelegate", _s_set_TestDelegate); + + + 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) == 1) + { + + var gen_ret = new Tutorial.DerivedClass(); + 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 Tutorial.DerivedClass constructor!"); + + } + + + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __AddMeta(RealStatePtr L) + { + + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + if (translator.Assignable(L, 1) && translator.Assignable(L, 2)) + { + Tutorial.DerivedClass leftside = (Tutorial.DerivedClass)translator.GetObject(L, 1, typeof(Tutorial.DerivedClass)); + Tutorial.DerivedClass rightside = (Tutorial.DerivedClass)translator.GetObject(L, 2, typeof(Tutorial.DerivedClass)); + + translator.Push(L, leftside + rightside); + + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return LuaAPI.luaL_error(L, "invalid arguments to right hand of + operator, need Tutorial.DerivedClass!"); + + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_DMFunc(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.DMFunc( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_ComplexFunc(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + + { + Tutorial.Param1 _p1;translator.Get(L, 2, out _p1); + int _p2 = LuaAPI.xlua_tointeger(L, 3); + string _p3; + System.Action _luafunc = translator.GetDelegate(L, 4); + System.Action _csfunc; + + var gen_ret = gen_to_be_invoked.ComplexFunc( _p1, ref _p2, out _p3, _luafunc, out _csfunc ); + LuaAPI.lua_pushnumber(L, gen_ret); + LuaAPI.xlua_pushinteger(L, _p2); + + LuaAPI.lua_pushstring(L, _p3); + + translator.Push(L, _csfunc); + + + + + return 4; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_TestFunc(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) + { + int _i = LuaAPI.xlua_tointeger(L, 2); + + gen_to_be_invoked.TestFunc( _i ); + + + + return 0; + } + if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) + { + string _i = LuaAPI.lua_tostring(L, 2); + + gen_to_be_invoked.TestFunc( _i ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + return LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DerivedClass.TestFunc!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_DefaultValueFunc(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 4&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING)) + { + int _a = LuaAPI.xlua_tointeger(L, 2); + string _b = LuaAPI.lua_tostring(L, 3); + string _c = LuaAPI.lua_tostring(L, 4); + + gen_to_be_invoked.DefaultValueFunc( _a, _b, _c ); + + + + return 0; + } + if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING)) + { + int _a = LuaAPI.xlua_tointeger(L, 2); + string _b = LuaAPI.lua_tostring(L, 3); + + gen_to_be_invoked.DefaultValueFunc( _a, _b ); + + + + return 0; + } + if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) + { + int _a = LuaAPI.xlua_tointeger(L, 2); + + gen_to_be_invoked.DefaultValueFunc( _a ); + + + + return 0; + } + if(gen_param_count == 1) + { + + gen_to_be_invoked.DefaultValueFunc( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + return LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DerivedClass.DefaultValueFunc!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_VariableParamsFunc(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + + { + int _a = LuaAPI.xlua_tointeger(L, 2); + string[] _strs = translator.GetParams(L, 3); + + gen_to_be_invoked.VariableParamsFunc( _a, _strs ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_EnumTestFunc(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + + { + Tutorial.TestEnum _e;translator.Get(L, 2, out _e); + + var gen_ret = gen_to_be_invoked.EnumTestFunc( _e ); + translator.PushTutorialTestEnum(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_CallEvent(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.CallEvent( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_TestLong(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + + { + long _n = LuaAPI.lua_toint64(L, 2); + + var gen_ret = gen_to_be_invoked.TestLong( _n ); + LuaAPI.lua_pushuint64(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetCalc(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + + { + + var gen_ret = gen_to_be_invoked.GetCalc( ); + translator.PushAny(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetSomeData(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + + { + + var gen_ret = gen_to_be_invoked.GetSomeData( ); + LuaAPI.xlua_pushinteger(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GenericMethodOfString(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.GenericMethodOfString( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_DMF(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.DMF); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_TestDelegate(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.TestDelegate); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_DMF(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.DMF = LuaAPI.xlua_tointeger(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_TestDelegate(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.TestDelegate = translator.GetDelegate>(L, 2); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _e_TestEvent(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + int gen_param_count = LuaAPI.lua_gettop(L); + Tutorial.DerivedClass gen_to_be_invoked = (Tutorial.DerivedClass)translator.FastGetCSObj(L, 1); + System.Action gen_delegate = translator.GetDelegate(L, 3); + if (gen_delegate == null) { + return LuaAPI.luaL_error(L, "#3 need System.Action!"); + } + + if (gen_param_count == 3) + { + + if (LuaAPI.xlua_is_eq_str(L, 2, "+")) { + gen_to_be_invoked.TestEvent += gen_delegate; + return 0; + } + + + if (LuaAPI.xlua_is_eq_str(L, 2, "-")) { + gen_to_be_invoked.TestEvent -= gen_delegate; + return 0; + } + + } + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + LuaAPI.luaL_error(L, "invalid arguments to Tutorial.DerivedClass.TestEvent!"); + return 0; + } + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassWrap.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassWrap.cs.meta new file mode 100644 index 0000000..e772133 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_DerivedClassWrap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a1e2105147dc7d42b21443fbb0db39e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_ICalcWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_ICalcWrap.cs new file mode 100644 index 0000000..3f2bccd --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_ICalcWrap.cs @@ -0,0 +1,98 @@ +#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 TutorialICalcWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(Tutorial.ICalc); + Utils.BeginObjectRegister(type, L, translator, 0, 1, 0, 0); + + Utils.RegisterFunc(L, Utils.METHOD_IDX, "add", _m_add); + + + + + + 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) + { + return LuaAPI.luaL_error(L, "Tutorial.ICalc does not have a constructor!"); + } + + + + + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_add(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + Tutorial.ICalc gen_to_be_invoked = (Tutorial.ICalc)translator.FastGetCSObj(L, 1); + + + + { + int _a = LuaAPI.xlua_tointeger(L, 2); + int _b = LuaAPI.xlua_tointeger(L, 3); + + var gen_ret = gen_to_be_invoked.add( _a, _b ); + LuaAPI.xlua_pushinteger(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + + + + + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_ICalcWrap.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_ICalcWrap.cs.meta new file mode 100644 index 0000000..ecd8f98 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/Tutorial_ICalcWrap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1fd82972487ca4541b15de0fdc2bf567 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_GameObjectWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_GameObjectWrap.cs new file mode 100644 index 0000000..cc78bc0 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_GameObjectWrap.cs @@ -0,0 +1,1023 @@ +#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 UnityEngineGameObjectWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(UnityEngine.GameObject); + Utils.BeginObjectRegister(type, L, translator, 0, 13, 9, 3); + + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetComponent", _m_GetComponent); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetComponentInChildren", _m_GetComponentInChildren); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetComponentInParent", _m_GetComponentInParent); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetComponents", _m_GetComponents); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetComponentsInChildren", _m_GetComponentsInChildren); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetComponentsInParent", _m_GetComponentsInParent); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetComponent", _m_TryGetComponent); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SendMessageUpwards", _m_SendMessageUpwards); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SendMessage", _m_SendMessage); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "BroadcastMessage", _m_BroadcastMessage); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "AddComponent", _m_AddComponent); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetActive", _m_SetActive); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "CompareTag", _m_CompareTag); + + + Utils.RegisterFunc(L, Utils.GETTER_IDX, "transform", _g_get_transform); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "layer", _g_get_layer); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "activeSelf", _g_get_activeSelf); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "activeInHierarchy", _g_get_activeInHierarchy); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "isStatic", _g_get_isStatic); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "tag", _g_get_tag); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "scene", _g_get_scene); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "sceneCullingMask", _g_get_sceneCullingMask); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "gameObject", _g_get_gameObject); + + Utils.RegisterFunc(L, Utils.SETTER_IDX, "layer", _s_set_layer); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "isStatic", _s_set_isStatic); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "tag", _s_set_tag); + + + Utils.EndObjectRegister(type, L, translator, null, null, + null, null, null); + + Utils.BeginClassRegister(type, L, __CreateInstance, 6, 0, 0); + Utils.RegisterFunc(L, Utils.CLS_IDX, "CreatePrimitive", _m_CreatePrimitive_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "FindWithTag", _m_FindWithTag_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "FindGameObjectWithTag", _m_FindGameObjectWithTag_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "FindGameObjectsWithTag", _m_FindGameObjectsWithTag_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Find", _m_Find_xlua_st_); + + + + + + + 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) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) + { + string _name = LuaAPI.lua_tostring(L, 2); + + var gen_ret = new UnityEngine.GameObject(_name); + translator.Push(L, gen_ret); + + return 1; + } + if(LuaAPI.lua_gettop(L) == 1) + { + + var gen_ret = new UnityEngine.GameObject(); + translator.Push(L, gen_ret); + + return 1; + } + if(LuaAPI.lua_gettop(L) >= 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNONE == LuaAPI.lua_type(L, 3) || translator.Assignable(L, 3))) + { + string _name = LuaAPI.lua_tostring(L, 2); + System.Type[] _components = translator.GetParams(L, 3); + + var gen_ret = new UnityEngine.GameObject(_name, _components); + 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.GameObject constructor!"); + + } + + + + + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_CreatePrimitive_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.PrimitiveType _type;translator.Get(L, 1, out _type); + + var gen_ret = UnityEngine.GameObject.CreatePrimitive( _type ); + translator.Push(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetComponent(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + + var gen_ret = gen_to_be_invoked.GetComponent( _type ); + translator.Push(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) + { + string _type = LuaAPI.lua_tostring(L, 2); + + var gen_ret = gen_to_be_invoked.GetComponent( _type ); + 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.GameObject.GetComponent!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetComponentInChildren(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + + var gen_ret = gen_to_be_invoked.GetComponentInChildren( _type ); + translator.Push(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + bool _includeInactive = LuaAPI.lua_toboolean(L, 3); + + var gen_ret = gen_to_be_invoked.GetComponentInChildren( _type, _includeInactive ); + 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.GameObject.GetComponentInChildren!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetComponentInParent(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + + var gen_ret = gen_to_be_invoked.GetComponentInParent( _type ); + translator.Push(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + bool _includeInactive = LuaAPI.lua_toboolean(L, 3); + + var gen_ret = gen_to_be_invoked.GetComponentInParent( _type, _includeInactive ); + 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.GameObject.GetComponentInParent!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetComponents(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + + var gen_ret = gen_to_be_invoked.GetComponents( _type ); + translator.Push(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& translator.Assignable>(L, 3)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + System.Collections.Generic.List _results = (System.Collections.Generic.List)translator.GetObject(L, 3, typeof(System.Collections.Generic.List)); + + gen_to_be_invoked.GetComponents( _type, _results ); + + + + 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.GameObject.GetComponents!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetComponentsInChildren(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + + var gen_ret = gen_to_be_invoked.GetComponentsInChildren( _type ); + translator.Push(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + bool _includeInactive = LuaAPI.lua_toboolean(L, 3); + + var gen_ret = gen_to_be_invoked.GetComponentsInChildren( _type, _includeInactive ); + 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.GameObject.GetComponentsInChildren!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetComponentsInParent(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + + var gen_ret = gen_to_be_invoked.GetComponentsInParent( _type ); + translator.Push(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + bool _includeInactive = LuaAPI.lua_toboolean(L, 3); + + var gen_ret = gen_to_be_invoked.GetComponentsInParent( _type, _includeInactive ); + 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.GameObject.GetComponentsInParent!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_TryGetComponent(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + + { + System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + UnityEngine.Component _component; + + var gen_ret = gen_to_be_invoked.TryGetComponent( _type, out _component ); + LuaAPI.lua_pushboolean(L, gen_ret); + translator.Push(L, _component); + + + + + return 2; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_FindWithTag_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + string _tag = LuaAPI.lua_tostring(L, 1); + + var gen_ret = UnityEngine.GameObject.FindWithTag( _tag ); + translator.Push(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SendMessageUpwards(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + + gen_to_be_invoked.SendMessageUpwards( _methodName ); + + + + return 0; + } + if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + UnityEngine.SendMessageOptions _options;translator.Get(L, 3, out _options); + + gen_to_be_invoked.SendMessageUpwards( _methodName, _options ); + + + + return 0; + } + if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + object _value = translator.GetObject(L, 3, typeof(object)); + + gen_to_be_invoked.SendMessageUpwards( _methodName, _value ); + + + + return 0; + } + if(gen_param_count == 4&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)&& translator.Assignable(L, 4)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + object _value = translator.GetObject(L, 3, typeof(object)); + UnityEngine.SendMessageOptions _options;translator.Get(L, 4, out _options); + + gen_to_be_invoked.SendMessageUpwards( _methodName, _value, _options ); + + + + 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.GameObject.SendMessageUpwards!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SendMessage(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + + gen_to_be_invoked.SendMessage( _methodName ); + + + + return 0; + } + if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + UnityEngine.SendMessageOptions _options;translator.Get(L, 3, out _options); + + gen_to_be_invoked.SendMessage( _methodName, _options ); + + + + return 0; + } + if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + object _value = translator.GetObject(L, 3, typeof(object)); + + gen_to_be_invoked.SendMessage( _methodName, _value ); + + + + return 0; + } + if(gen_param_count == 4&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)&& translator.Assignable(L, 4)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + object _value = translator.GetObject(L, 3, typeof(object)); + UnityEngine.SendMessageOptions _options;translator.Get(L, 4, out _options); + + gen_to_be_invoked.SendMessage( _methodName, _value, _options ); + + + + 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.GameObject.SendMessage!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_BroadcastMessage(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + + gen_to_be_invoked.BroadcastMessage( _methodName ); + + + + return 0; + } + if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + UnityEngine.SendMessageOptions _options;translator.Get(L, 3, out _options); + + gen_to_be_invoked.BroadcastMessage( _methodName, _options ); + + + + return 0; + } + if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + object _parameter = translator.GetObject(L, 3, typeof(object)); + + gen_to_be_invoked.BroadcastMessage( _methodName, _parameter ); + + + + return 0; + } + if(gen_param_count == 4&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)&& translator.Assignable(L, 4)) + { + string _methodName = LuaAPI.lua_tostring(L, 2); + object _parameter = translator.GetObject(L, 3, typeof(object)); + UnityEngine.SendMessageOptions _options;translator.Get(L, 4, out _options); + + gen_to_be_invoked.BroadcastMessage( _methodName, _parameter, _options ); + + + + 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.GameObject.BroadcastMessage!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_AddComponent(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + + { + System.Type _componentType = (System.Type)translator.GetObject(L, 2, typeof(System.Type)); + + var gen_ret = gen_to_be_invoked.AddComponent( _componentType ); + translator.Push(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SetActive(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + + { + bool _value = LuaAPI.lua_toboolean(L, 2); + + gen_to_be_invoked.SetActive( _value ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_CompareTag(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + + + + { + string _tag = LuaAPI.lua_tostring(L, 2); + + var gen_ret = gen_to_be_invoked.CompareTag( _tag ); + LuaAPI.lua_pushboolean(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_FindGameObjectWithTag_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + string _tag = LuaAPI.lua_tostring(L, 1); + + var gen_ret = UnityEngine.GameObject.FindGameObjectWithTag( _tag ); + translator.Push(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_FindGameObjectsWithTag_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + string _tag = LuaAPI.lua_tostring(L, 1); + + var gen_ret = UnityEngine.GameObject.FindGameObjectsWithTag( _tag ); + translator.Push(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Find_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + string _name = LuaAPI.lua_tostring(L, 1); + + var gen_ret = UnityEngine.GameObject.Find( _name ); + translator.Push(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_transform(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.transform); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_layer(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.layer); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_activeSelf(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + LuaAPI.lua_pushboolean(L, gen_to_be_invoked.activeSelf); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_activeInHierarchy(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + LuaAPI.lua_pushboolean(L, gen_to_be_invoked.activeInHierarchy); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_isStatic(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + LuaAPI.lua_pushboolean(L, gen_to_be_invoked.isStatic); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_tag(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + LuaAPI.lua_pushstring(L, gen_to_be_invoked.tag); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_scene(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.scene); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_sceneCullingMask(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + LuaAPI.lua_pushuint64(L, gen_to_be_invoked.sceneCullingMask); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_gameObject(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.gameObject); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_layer(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.layer = LuaAPI.xlua_tointeger(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_isStatic(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.isStatic = 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_tag(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.tag = LuaAPI.lua_tostring(L, 2); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_GameObjectWrap.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_GameObjectWrap.cs.meta new file mode 100644 index 0000000..2c0eb8b --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_GameObjectWrap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00dc7cb182c9ccd42938e5397b60f1e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_QuaternionWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_QuaternionWrap.cs new file mode 100644 index 0000000..3fd60c8 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_QuaternionWrap.cs @@ -0,0 +1,1138 @@ +#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 UnityEngineQuaternionWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(UnityEngine.Quaternion); + Utils.BeginObjectRegister(type, L, translator, 2, 8, 6, 5); + Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__mul", __MulMeta); + Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__eq", __EqMeta); + + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Set", _m_Set); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetLookRotation", _m_SetLookRotation); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "ToAngleAxis", _m_ToAngleAxis); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetFromToRotation", _m_SetFromToRotation); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Normalize", _m_Normalize); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetHashCode", _m_GetHashCode); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Equals", _m_Equals); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "ToString", _m_ToString); + + + Utils.RegisterFunc(L, Utils.GETTER_IDX, "eulerAngles", _g_get_eulerAngles); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "normalized", _g_get_normalized); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "x", _g_get_x); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "y", _g_get_y); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "z", _g_get_z); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "w", _g_get_w); + + Utils.RegisterFunc(L, Utils.SETTER_IDX, "eulerAngles", _s_set_eulerAngles); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "x", _s_set_x); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "y", _s_set_y); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "z", _s_set_z); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "w", _s_set_w); + + + Utils.EndObjectRegister(type, L, translator, __CSIndexer, __NewIndexer, + null, null, null); + + Utils.BeginClassRegister(type, L, __CreateInstance, 15, 1, 0); + Utils.RegisterFunc(L, Utils.CLS_IDX, "FromToRotation", _m_FromToRotation_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Inverse", _m_Inverse_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Slerp", _m_Slerp_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "SlerpUnclamped", _m_SlerpUnclamped_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Lerp", _m_Lerp_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "LerpUnclamped", _m_LerpUnclamped_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "AngleAxis", _m_AngleAxis_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "LookRotation", _m_LookRotation_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Dot", _m_Dot_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Angle", _m_Angle_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Euler", _m_Euler_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "RotateTowards", _m_RotateTowards_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Normalize", _m_Normalize_xlua_st_); + + + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "kEpsilon", UnityEngine.Quaternion.kEpsilon); + + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "identity", _g_get_identity); + + + + 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) == 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 _x = (float)LuaAPI.lua_tonumber(L, 2); + float _y = (float)LuaAPI.lua_tonumber(L, 3); + float _z = (float)LuaAPI.lua_tonumber(L, 4); + float _w = (float)LuaAPI.lua_tonumber(L, 5); + + var gen_ret = new UnityEngine.Quaternion(_x, _y, _z, _w); + translator.PushUnityEngineQuaternion(L, gen_ret); + + return 1; + } + + if (LuaAPI.lua_gettop(L) == 1) + { + translator.PushUnityEngineQuaternion(L, default(UnityEngine.Quaternion)); + 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.Quaternion constructor!"); + + } + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + public static int __CSIndexer(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + if (translator.Assignable(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) + { + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + int index = LuaAPI.xlua_tointeger(L, 2); + LuaAPI.lua_pushboolean(L, true); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked[index]); + return 2; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + LuaAPI.lua_pushboolean(L, false); + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + public static int __NewIndexer(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + try { + + if (translator.Assignable(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) + { + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + int key = LuaAPI.xlua_tointeger(L, 2); + gen_to_be_invoked[key] = (float)LuaAPI.lua_tonumber(L, 3); + LuaAPI.lua_pushboolean(L, true); + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + LuaAPI.lua_pushboolean(L, false); + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __MulMeta(RealStatePtr L) + { + + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + if (translator.Assignable(L, 1) && translator.Assignable(L, 2)) + { + UnityEngine.Quaternion leftside;translator.Get(L, 1, out leftside); + UnityEngine.Quaternion rightside;translator.Get(L, 2, out rightside); + + translator.PushUnityEngineQuaternion(L, leftside * rightside); + + return 1; + } + + + if (translator.Assignable(L, 1) && translator.Assignable(L, 2)) + { + UnityEngine.Quaternion leftside;translator.Get(L, 1, out leftside); + UnityEngine.Vector3 rightside;translator.Get(L, 2, out rightside); + + translator.PushUnityEngineVector3(L, leftside * rightside); + + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return LuaAPI.luaL_error(L, "invalid arguments to right hand of * operator, need UnityEngine.Quaternion!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __EqMeta(RealStatePtr L) + { + + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + if (translator.Assignable(L, 1) && translator.Assignable(L, 2)) + { + UnityEngine.Quaternion leftside;translator.Get(L, 1, out leftside); + UnityEngine.Quaternion rightside;translator.Get(L, 2, out rightside); + + LuaAPI.lua_pushboolean(L, leftside == rightside); + + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return LuaAPI.luaL_error(L, "invalid arguments to right hand of == operator, need UnityEngine.Quaternion!"); + + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_FromToRotation_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _fromDirection;translator.Get(L, 1, out _fromDirection); + UnityEngine.Vector3 _toDirection;translator.Get(L, 2, out _toDirection); + + var gen_ret = UnityEngine.Quaternion.FromToRotation( _fromDirection, _toDirection ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Inverse_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Quaternion _rotation;translator.Get(L, 1, out _rotation); + + var gen_ret = UnityEngine.Quaternion.Inverse( _rotation ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Slerp_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Quaternion _a;translator.Get(L, 1, out _a); + UnityEngine.Quaternion _b;translator.Get(L, 2, out _b); + float _t = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Quaternion.Slerp( _a, _b, _t ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SlerpUnclamped_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Quaternion _a;translator.Get(L, 1, out _a); + UnityEngine.Quaternion _b;translator.Get(L, 2, out _b); + float _t = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Quaternion.SlerpUnclamped( _a, _b, _t ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Lerp_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Quaternion _a;translator.Get(L, 1, out _a); + UnityEngine.Quaternion _b;translator.Get(L, 2, out _b); + float _t = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Quaternion.Lerp( _a, _b, _t ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_LerpUnclamped_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Quaternion _a;translator.Get(L, 1, out _a); + UnityEngine.Quaternion _b;translator.Get(L, 2, out _b); + float _t = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Quaternion.LerpUnclamped( _a, _b, _t ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_AngleAxis_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + float _angle = (float)LuaAPI.lua_tonumber(L, 1); + UnityEngine.Vector3 _axis;translator.Get(L, 2, out _axis); + + var gen_ret = UnityEngine.Quaternion.AngleAxis( _angle, _axis ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_LookRotation_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 1&& translator.Assignable(L, 1)) + { + UnityEngine.Vector3 _forward;translator.Get(L, 1, out _forward); + + var gen_ret = UnityEngine.Quaternion.LookRotation( _forward ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 2&& translator.Assignable(L, 1)&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _forward;translator.Get(L, 1, out _forward); + UnityEngine.Vector3 _upwards;translator.Get(L, 2, out _upwards); + + var gen_ret = UnityEngine.Quaternion.LookRotation( _forward, _upwards ); + translator.PushUnityEngineQuaternion(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.Quaternion.LookRotation!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Set(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + + { + float _newX = (float)LuaAPI.lua_tonumber(L, 2); + float _newY = (float)LuaAPI.lua_tonumber(L, 3); + float _newZ = (float)LuaAPI.lua_tonumber(L, 4); + float _newW = (float)LuaAPI.lua_tonumber(L, 5); + + gen_to_be_invoked.Set( _newX, _newY, _newZ, _newW ); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Dot_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Quaternion _a;translator.Get(L, 1, out _a); + UnityEngine.Quaternion _b;translator.Get(L, 2, out _b); + + var gen_ret = UnityEngine.Quaternion.Dot( _a, _b ); + LuaAPI.lua_pushnumber(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SetLookRotation(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _view;translator.Get(L, 2, out _view); + + gen_to_be_invoked.SetLookRotation( _view ); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + return 0; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& translator.Assignable(L, 3)) + { + UnityEngine.Vector3 _view;translator.Get(L, 2, out _view); + UnityEngine.Vector3 _up;translator.Get(L, 3, out _up); + + gen_to_be_invoked.SetLookRotation( _view, _up ); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + 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.Quaternion.SetLookRotation!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Angle_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Quaternion _a;translator.Get(L, 1, out _a); + UnityEngine.Quaternion _b;translator.Get(L, 2, out _b); + + var gen_ret = UnityEngine.Quaternion.Angle( _a, _b ); + LuaAPI.lua_pushnumber(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Euler_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) + { + float _x = (float)LuaAPI.lua_tonumber(L, 1); + float _y = (float)LuaAPI.lua_tonumber(L, 2); + float _z = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Quaternion.Euler( _x, _y, _z ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 1&& translator.Assignable(L, 1)) + { + UnityEngine.Vector3 _euler;translator.Get(L, 1, out _euler); + + var gen_ret = UnityEngine.Quaternion.Euler( _euler ); + translator.PushUnityEngineQuaternion(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.Quaternion.Euler!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_ToAngleAxis(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + + { + float _angle; + UnityEngine.Vector3 _axis; + + gen_to_be_invoked.ToAngleAxis( out _angle, out _axis ); + LuaAPI.lua_pushnumber(L, _angle); + + translator.PushUnityEngineVector3(L, _axis); + + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + return 2; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SetFromToRotation(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + + { + UnityEngine.Vector3 _fromDirection;translator.Get(L, 2, out _fromDirection); + UnityEngine.Vector3 _toDirection;translator.Get(L, 3, out _toDirection); + + gen_to_be_invoked.SetFromToRotation( _fromDirection, _toDirection ); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_RotateTowards_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Quaternion _from;translator.Get(L, 1, out _from); + UnityEngine.Quaternion _to;translator.Get(L, 2, out _to); + float _maxDegreesDelta = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Quaternion.RotateTowards( _from, _to, _maxDegreesDelta ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Normalize_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Quaternion _q;translator.Get(L, 1, out _q); + + var gen_ret = UnityEngine.Quaternion.Normalize( _q ); + translator.PushUnityEngineQuaternion(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Normalize(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + + { + + gen_to_be_invoked.Normalize( ); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetHashCode(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + + { + + var gen_ret = gen_to_be_invoked.GetHashCode( ); + LuaAPI.xlua_pushinteger(L, gen_ret); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Equals(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + object _other = translator.GetObject(L, 2, typeof(object)); + + var gen_ret = gen_to_be_invoked.Equals( _other ); + LuaAPI.lua_pushboolean(L, gen_ret); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + return 1; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Quaternion _other;translator.Get(L, 2, out _other); + + var gen_ret = gen_to_be_invoked.Equals( _other ); + LuaAPI.lua_pushboolean(L, gen_ret); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + 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.Quaternion.Equals!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_ToString(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 1) + { + + var gen_ret = gen_to_be_invoked.ToString( ); + LuaAPI.lua_pushstring(L, gen_ret); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + return 1; + } + if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) + { + string _format = LuaAPI.lua_tostring(L, 2); + + var gen_ret = gen_to_be_invoked.ToString( _format ); + LuaAPI.lua_pushstring(L, gen_ret); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + return 1; + } + if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)) + { + string _format = LuaAPI.lua_tostring(L, 2); + System.IFormatProvider _formatProvider = (System.IFormatProvider)translator.GetObject(L, 3, typeof(System.IFormatProvider)); + + var gen_ret = gen_to_be_invoked.ToString( _format, _formatProvider ); + LuaAPI.lua_pushstring(L, gen_ret); + + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + + 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.Quaternion.ToString!"); + + } + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_identity(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineQuaternion(L, UnityEngine.Quaternion.identity); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_eulerAngles(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + translator.PushUnityEngineVector3(L, gen_to_be_invoked.eulerAngles); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_normalized(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + translator.PushUnityEngineQuaternion(L, gen_to_be_invoked.normalized); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_x(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked.x); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_y(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked.y); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_z(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked.z); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_w(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked.w); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_eulerAngles(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + UnityEngine.Vector3 gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.eulerAngles = gen_value; + + translator.UpdateUnityEngineQuaternion(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_x(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + gen_to_be_invoked.x = (float)LuaAPI.lua_tonumber(L, 2); + + translator.UpdateUnityEngineQuaternion(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_y(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + gen_to_be_invoked.y = (float)LuaAPI.lua_tonumber(L, 2); + + translator.UpdateUnityEngineQuaternion(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_z(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + gen_to_be_invoked.z = (float)LuaAPI.lua_tonumber(L, 2); + + translator.UpdateUnityEngineQuaternion(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_w(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Quaternion gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + gen_to_be_invoked.w = (float)LuaAPI.lua_tonumber(L, 2); + + translator.UpdateUnityEngineQuaternion(L, 1, gen_to_be_invoked); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_QuaternionWrap.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_QuaternionWrap.cs.meta new file mode 100644 index 0000000..7d6f04a --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_QuaternionWrap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6b38efebc78e59249b286e3852bc4381 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_TransformWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_TransformWrap.cs new file mode 100644 index 0000000..9675842 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_TransformWrap.cs @@ -0,0 +1,1567 @@ +#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 UnityEngineTransformWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(UnityEngine.Transform); + Utils.BeginObjectRegister(type, L, translator, 0, 24, 19, 13); + + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetParent", _m_SetParent); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetPositionAndRotation", _m_SetPositionAndRotation); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Translate", _m_Translate); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Rotate", _m_Rotate); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "RotateAround", _m_RotateAround); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "LookAt", _m_LookAt); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "TransformDirection", _m_TransformDirection); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "InverseTransformDirection", _m_InverseTransformDirection); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "TransformVector", _m_TransformVector); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "InverseTransformVector", _m_InverseTransformVector); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "TransformPoint", _m_TransformPoint); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "InverseTransformPoint", _m_InverseTransformPoint); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "DetachChildren", _m_DetachChildren); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetAsFirstSibling", _m_SetAsFirstSibling); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetAsLastSibling", _m_SetAsLastSibling); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetSiblingIndex", _m_SetSiblingIndex); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSiblingIndex", _m_GetSiblingIndex); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Find", _m_Find); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsChildOf", _m_IsChildOf); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetEnumerator", _m_GetEnumerator); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetChild", _m_GetChild); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetPosition", _m_GetPosition); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetPosition", _m_SetPosition); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Rotation", _m_Rotation); + + + Utils.RegisterFunc(L, Utils.GETTER_IDX, "position", _g_get_position); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "localPosition", _g_get_localPosition); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "eulerAngles", _g_get_eulerAngles); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "localEulerAngles", _g_get_localEulerAngles); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "right", _g_get_right); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "up", _g_get_up); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "forward", _g_get_forward); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "rotation", _g_get_rotation); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "localRotation", _g_get_localRotation); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "localScale", _g_get_localScale); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "parent", _g_get_parent); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "worldToLocalMatrix", _g_get_worldToLocalMatrix); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "localToWorldMatrix", _g_get_localToWorldMatrix); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "root", _g_get_root); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "childCount", _g_get_childCount); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "lossyScale", _g_get_lossyScale); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "hasChanged", _g_get_hasChanged); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "hierarchyCapacity", _g_get_hierarchyCapacity); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "hierarchyCount", _g_get_hierarchyCount); + + Utils.RegisterFunc(L, Utils.SETTER_IDX, "position", _s_set_position); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "localPosition", _s_set_localPosition); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "eulerAngles", _s_set_eulerAngles); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "localEulerAngles", _s_set_localEulerAngles); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "right", _s_set_right); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "up", _s_set_up); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "forward", _s_set_forward); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "rotation", _s_set_rotation); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "localRotation", _s_set_localRotation); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "localScale", _s_set_localScale); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "parent", _s_set_parent); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "hasChanged", _s_set_hasChanged); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "hierarchyCapacity", _s_set_hierarchyCapacity); + + + 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) + { + return LuaAPI.luaL_error(L, "UnityEngine.Transform does not have a constructor!"); + } + + + + + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SetParent(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 == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Transform _p = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform)); + + gen_to_be_invoked.SetParent( _p ); + + + + return 0; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)) + { + UnityEngine.Transform _parent = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform)); + bool _worldPositionStays = LuaAPI.lua_toboolean(L, 3); + + gen_to_be_invoked.SetParent( _parent, _worldPositionStays ); + + + + 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.SetParent!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SetPositionAndRotation(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + UnityEngine.Vector3 _position;translator.Get(L, 2, out _position); + UnityEngine.Quaternion _rotation;translator.Get(L, 3, out _rotation); + + gen_to_be_invoked.SetPositionAndRotation( _position, _rotation ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Translate(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 == 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.Translate( _x, _y, _z ); + + + + return 0; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _translation;translator.Get(L, 2, out _translation); + + gen_to_be_invoked.Translate( _translation ); + + + + return 0; + } + 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)&& translator.Assignable(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); + UnityEngine.Space _relativeTo;translator.Get(L, 5, out _relativeTo); + + gen_to_be_invoked.Translate( _x, _y, _z, _relativeTo ); + + + + return 0; + } + 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)&& translator.Assignable(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); + UnityEngine.Transform _relativeTo = (UnityEngine.Transform)translator.GetObject(L, 5, typeof(UnityEngine.Transform)); + + gen_to_be_invoked.Translate( _x, _y, _z, _relativeTo ); + + + + return 0; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& translator.Assignable(L, 3)) + { + UnityEngine.Vector3 _translation;translator.Get(L, 2, out _translation); + UnityEngine.Space _relativeTo;translator.Get(L, 3, out _relativeTo); + + gen_to_be_invoked.Translate( _translation, _relativeTo ); + + + + return 0; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& translator.Assignable(L, 3)) + { + UnityEngine.Vector3 _translation;translator.Get(L, 2, out _translation); + UnityEngine.Transform _relativeTo = (UnityEngine.Transform)translator.GetObject(L, 3, typeof(UnityEngine.Transform)); + + gen_to_be_invoked.Translate( _translation, _relativeTo ); + + + + 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.Translate!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Rotate(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 == 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 _xAngle = (float)LuaAPI.lua_tonumber(L, 2); + float _yAngle = (float)LuaAPI.lua_tonumber(L, 3); + float _zAngle = (float)LuaAPI.lua_tonumber(L, 4); + + gen_to_be_invoked.Rotate( _xAngle, _yAngle, _zAngle ); + + + + return 0; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _eulers;translator.Get(L, 2, out _eulers); + + gen_to_be_invoked.Rotate( _eulers ); + + + + return 0; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) + { + UnityEngine.Vector3 _axis;translator.Get(L, 2, out _axis); + float _angle = (float)LuaAPI.lua_tonumber(L, 3); + + gen_to_be_invoked.Rotate( _axis, _angle ); + + + + return 0; + } + 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)&& translator.Assignable(L, 5)) + { + float _xAngle = (float)LuaAPI.lua_tonumber(L, 2); + float _yAngle = (float)LuaAPI.lua_tonumber(L, 3); + float _zAngle = (float)LuaAPI.lua_tonumber(L, 4); + UnityEngine.Space _relativeTo;translator.Get(L, 5, out _relativeTo); + + gen_to_be_invoked.Rotate( _xAngle, _yAngle, _zAngle, _relativeTo ); + + + + return 0; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& translator.Assignable(L, 3)) + { + UnityEngine.Vector3 _eulers;translator.Get(L, 2, out _eulers); + UnityEngine.Space _relativeTo;translator.Get(L, 3, out _relativeTo); + + gen_to_be_invoked.Rotate( _eulers, _relativeTo ); + + + + return 0; + } + if(gen_param_count == 4&& translator.Assignable(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& translator.Assignable(L, 4)) + { + UnityEngine.Vector3 _axis;translator.Get(L, 2, out _axis); + float _angle = (float)LuaAPI.lua_tonumber(L, 3); + UnityEngine.Space _relativeTo;translator.Get(L, 4, out _relativeTo); + + gen_to_be_invoked.Rotate( _axis, _angle, _relativeTo ); + + + + 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.Rotate!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_RotateAround(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + UnityEngine.Vector3 _point;translator.Get(L, 2, out _point); + UnityEngine.Vector3 _axis;translator.Get(L, 3, out _axis); + float _angle = (float)LuaAPI.lua_tonumber(L, 4); + + gen_to_be_invoked.RotateAround( _point, _axis, _angle ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_LookAt(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 == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Transform _target = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform)); + + gen_to_be_invoked.LookAt( _target ); + + + + return 0; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _worldPosition;translator.Get(L, 2, out _worldPosition); + + gen_to_be_invoked.LookAt( _worldPosition ); + + + + return 0; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& translator.Assignable(L, 3)) + { + UnityEngine.Transform _target = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform)); + UnityEngine.Vector3 _worldUp;translator.Get(L, 3, out _worldUp); + + gen_to_be_invoked.LookAt( _target, _worldUp ); + + + + return 0; + } + if(gen_param_count == 3&& translator.Assignable(L, 2)&& translator.Assignable(L, 3)) + { + UnityEngine.Vector3 _worldPosition;translator.Get(L, 2, out _worldPosition); + UnityEngine.Vector3 _worldUp;translator.Get(L, 3, out _worldUp); + + gen_to_be_invoked.LookAt( _worldPosition, _worldUp ); + + + + 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.LookAt!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_TransformDirection(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 == 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); + + var gen_ret = gen_to_be_invoked.TransformDirection( _x, _y, _z ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _direction;translator.Get(L, 2, out _direction); + + var gen_ret = gen_to_be_invoked.TransformDirection( _direction ); + translator.PushUnityEngineVector3(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.Transform.TransformDirection!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_InverseTransformDirection(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 == 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); + + var gen_ret = gen_to_be_invoked.InverseTransformDirection( _x, _y, _z ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _direction;translator.Get(L, 2, out _direction); + + var gen_ret = gen_to_be_invoked.InverseTransformDirection( _direction ); + translator.PushUnityEngineVector3(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.Transform.InverseTransformDirection!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_TransformVector(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 == 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); + + var gen_ret = gen_to_be_invoked.TransformVector( _x, _y, _z ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _vector;translator.Get(L, 2, out _vector); + + var gen_ret = gen_to_be_invoked.TransformVector( _vector ); + translator.PushUnityEngineVector3(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.Transform.TransformVector!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_InverseTransformVector(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 == 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); + + var gen_ret = gen_to_be_invoked.InverseTransformVector( _x, _y, _z ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _vector;translator.Get(L, 2, out _vector); + + var gen_ret = gen_to_be_invoked.InverseTransformVector( _vector ); + translator.PushUnityEngineVector3(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.Transform.InverseTransformVector!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_TransformPoint(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 == 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); + + var gen_ret = gen_to_be_invoked.TransformPoint( _x, _y, _z ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _position;translator.Get(L, 2, out _position); + + var gen_ret = gen_to_be_invoked.TransformPoint( _position ); + translator.PushUnityEngineVector3(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.Transform.TransformPoint!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_InverseTransformPoint(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 == 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); + + var gen_ret = gen_to_be_invoked.InverseTransformPoint( _x, _y, _z ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _position;translator.Get(L, 2, out _position); + + var gen_ret = gen_to_be_invoked.InverseTransformPoint( _position ); + translator.PushUnityEngineVector3(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.Transform.InverseTransformPoint!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_DetachChildren(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.DetachChildren( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SetAsFirstSibling(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.SetAsFirstSibling( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SetAsLastSibling(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + + gen_to_be_invoked.SetAsLastSibling( ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SetSiblingIndex(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + int _index = LuaAPI.xlua_tointeger(L, 2); + + gen_to_be_invoked.SetSiblingIndex( _index ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetSiblingIndex(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + + var gen_ret = gen_to_be_invoked.GetSiblingIndex( ); + LuaAPI.xlua_pushinteger(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Find(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + string _n = LuaAPI.lua_tostring(L, 2); + + var gen_ret = gen_to_be_invoked.Find( _n ); + translator.Push(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_IsChildOf(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + UnityEngine.Transform _parent = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform)); + + var gen_ret = gen_to_be_invoked.IsChildOf( _parent ); + LuaAPI.lua_pushboolean(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetEnumerator(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + + var gen_ret = gen_to_be_invoked.GetEnumerator( ); + translator.PushAny(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetChild(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + int _index = LuaAPI.xlua_tointeger(L, 2); + + var gen_ret = gen_to_be_invoked.GetChild( _index ); + translator.Push(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetPosition(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + float _x; + float _y; + float _z; + + gen_to_be_invoked.GetPosition( out _x, out _y, out _z ); + LuaAPI.lua_pushnumber(L, _x); + + LuaAPI.lua_pushnumber(L, _y); + + LuaAPI.lua_pushnumber(L, _z); + + + + + return 3; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [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); + + + + { + 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); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Rotation(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + + + + { + 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.Rotation( _x, _y, _z ); + + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_position(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineVector3(L, gen_to_be_invoked.position); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_localPosition(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineVector3(L, gen_to_be_invoked.localPosition); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_eulerAngles(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineVector3(L, gen_to_be_invoked.eulerAngles); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_localEulerAngles(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineVector3(L, gen_to_be_invoked.localEulerAngles); + } 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 { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineVector3(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_up(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineVector3(L, gen_to_be_invoked.up); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_forward(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineVector3(L, gen_to_be_invoked.forward); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_rotation(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineQuaternion(L, gen_to_be_invoked.rotation); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_localRotation(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineQuaternion(L, gen_to_be_invoked.localRotation); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_localScale(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineVector3(L, gen_to_be_invoked.localScale); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_parent(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.parent); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_worldToLocalMatrix(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.worldToLocalMatrix); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_localToWorldMatrix(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.localToWorldMatrix); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_root(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.root); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_childCount(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.childCount); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_lossyScale(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + translator.PushUnityEngineVector3(L, gen_to_be_invoked.lossyScale); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_hasChanged(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + LuaAPI.lua_pushboolean(L, gen_to_be_invoked.hasChanged); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_hierarchyCapacity(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.hierarchyCapacity); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_hierarchyCount(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.hierarchyCount); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_position(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + UnityEngine.Vector3 gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.position = gen_value; + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_localPosition(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + UnityEngine.Vector3 gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.localPosition = gen_value; + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_eulerAngles(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + UnityEngine.Vector3 gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.eulerAngles = gen_value; + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_localEulerAngles(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + UnityEngine.Vector3 gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.localEulerAngles = gen_value; + + } 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 { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + UnityEngine.Vector3 gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.right = gen_value; + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_up(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + UnityEngine.Vector3 gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.up = gen_value; + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_forward(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + UnityEngine.Vector3 gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.forward = gen_value; + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_rotation(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + UnityEngine.Quaternion gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.rotation = gen_value; + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_localRotation(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + UnityEngine.Quaternion gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.localRotation = gen_value; + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_localScale(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + UnityEngine.Vector3 gen_value;translator.Get(L, 2, out gen_value); + gen_to_be_invoked.localScale = gen_value; + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_parent(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.parent = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform)); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_hasChanged(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.hasChanged = 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_hierarchyCapacity(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Transform gen_to_be_invoked = (UnityEngine.Transform)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.hierarchyCapacity = LuaAPI.xlua_tointeger(L, 2); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_TransformWrap.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_TransformWrap.cs.meta new file mode 100644 index 0000000..70c1dd4 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_TransformWrap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 06504dd9219e3924d94fb2f9cc7b76e7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_Vector3Wrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_Vector3Wrap.cs new file mode 100644 index 0000000..c9840d6 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_Vector3Wrap.cs @@ -0,0 +1,1576 @@ +#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 UnityEngineVector3Wrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(UnityEngine.Vector3); + Utils.BeginObjectRegister(type, L, translator, 6, 6, 6, 3); + Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__add", __AddMeta); + Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__sub", __SubMeta); + Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__unm", __UnmMeta); + Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__mul", __MulMeta); + Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__div", __DivMeta); + Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__eq", __EqMeta); + + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Set", _m_Set); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Scale", _m_Scale); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetHashCode", _m_GetHashCode); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Equals", _m_Equals); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "Normalize", _m_Normalize); + Utils.RegisterFunc(L, Utils.METHOD_IDX, "ToString", _m_ToString); + + + Utils.RegisterFunc(L, Utils.GETTER_IDX, "normalized", _g_get_normalized); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "magnitude", _g_get_magnitude); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "sqrMagnitude", _g_get_sqrMagnitude); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "x", _g_get_x); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "y", _g_get_y); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "z", _g_get_z); + + Utils.RegisterFunc(L, Utils.SETTER_IDX, "x", _s_set_x); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "y", _s_set_y); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "z", _s_set_z); + + + Utils.EndObjectRegister(type, L, translator, __CSIndexer, __NewIndexer, + null, null, null); + + Utils.BeginClassRegister(type, L, __CreateInstance, 26, 10, 0); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Slerp", _m_Slerp_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "SlerpUnclamped", _m_SlerpUnclamped_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "OrthoNormalize", _m_OrthoNormalize_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "RotateTowards", _m_RotateTowards_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Lerp", _m_Lerp_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "LerpUnclamped", _m_LerpUnclamped_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "MoveTowards", _m_MoveTowards_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "SmoothDamp", _m_SmoothDamp_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Scale", _m_Scale_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Cross", _m_Cross_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Reflect", _m_Reflect_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Normalize", _m_Normalize_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Dot", _m_Dot_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Project", _m_Project_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "ProjectOnPlane", _m_ProjectOnPlane_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Angle", _m_Angle_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "SignedAngle", _m_SignedAngle_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Distance", _m_Distance_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "ClampMagnitude", _m_ClampMagnitude_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Magnitude", _m_Magnitude_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "SqrMagnitude", _m_SqrMagnitude_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Min", _m_Min_xlua_st_); + Utils.RegisterFunc(L, Utils.CLS_IDX, "Max", _m_Max_xlua_st_); + + + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "kEpsilon", UnityEngine.Vector3.kEpsilon); + Utils.RegisterObject(L, translator, Utils.CLS_IDX, "kEpsilonNormalSqrt", UnityEngine.Vector3.kEpsilonNormalSqrt); + + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "zero", _g_get_zero); + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "one", _g_get_one); + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "forward", _g_get_forward); + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "back", _g_get_back); + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "up", _g_get_up); + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "down", _g_get_down); + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "left", _g_get_left); + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "right", _g_get_right); + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "positiveInfinity", _g_get_positiveInfinity); + Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "negativeInfinity", _g_get_negativeInfinity); + + + + 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) == 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); + + var gen_ret = new UnityEngine.Vector3(_x, _y, _z); + translator.PushUnityEngineVector3(L, gen_ret); + + return 1; + } + if(LuaAPI.lua_gettop(L) == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) + { + float _x = (float)LuaAPI.lua_tonumber(L, 2); + float _y = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = new UnityEngine.Vector3(_x, _y); + translator.PushUnityEngineVector3(L, gen_ret); + + return 1; + } + + if (LuaAPI.lua_gettop(L) == 1) + { + translator.PushUnityEngineVector3(L, default(UnityEngine.Vector3)); + 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.Vector3 constructor!"); + + } + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + public static int __CSIndexer(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + if (translator.Assignable(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) + { + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + int index = LuaAPI.xlua_tointeger(L, 2); + LuaAPI.lua_pushboolean(L, true); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked[index]); + return 2; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + LuaAPI.lua_pushboolean(L, false); + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + public static int __NewIndexer(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + try { + + if (translator.Assignable(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) + { + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + int key = LuaAPI.xlua_tointeger(L, 2); + gen_to_be_invoked[key] = (float)LuaAPI.lua_tonumber(L, 3); + LuaAPI.lua_pushboolean(L, true); + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + LuaAPI.lua_pushboolean(L, false); + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __AddMeta(RealStatePtr L) + { + + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + if (translator.Assignable(L, 1) && translator.Assignable(L, 2)) + { + UnityEngine.Vector3 leftside;translator.Get(L, 1, out leftside); + UnityEngine.Vector3 rightside;translator.Get(L, 2, out rightside); + + translator.PushUnityEngineVector3(L, leftside + rightside); + + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return LuaAPI.luaL_error(L, "invalid arguments to right hand of + operator, need UnityEngine.Vector3!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __SubMeta(RealStatePtr L) + { + + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + if (translator.Assignable(L, 1) && translator.Assignable(L, 2)) + { + UnityEngine.Vector3 leftside;translator.Get(L, 1, out leftside); + UnityEngine.Vector3 rightside;translator.Get(L, 2, out rightside); + + translator.PushUnityEngineVector3(L, leftside - rightside); + + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return LuaAPI.luaL_error(L, "invalid arguments to right hand of - operator, need UnityEngine.Vector3!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __UnmMeta(RealStatePtr L) + { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + try { + UnityEngine.Vector3 rightside;translator.Get(L, 1, out rightside); + translator.PushUnityEngineVector3(L, - rightside); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __MulMeta(RealStatePtr L) + { + + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + if (translator.Assignable(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) + { + UnityEngine.Vector3 leftside;translator.Get(L, 1, out leftside); + float rightside = (float)LuaAPI.lua_tonumber(L, 2); + + translator.PushUnityEngineVector3(L, leftside * rightside); + + return 1; + } + + + if (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && translator.Assignable(L, 2)) + { + float leftside = (float)LuaAPI.lua_tonumber(L, 1); + UnityEngine.Vector3 rightside;translator.Get(L, 2, out rightside); + + translator.PushUnityEngineVector3(L, leftside * rightside); + + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return LuaAPI.luaL_error(L, "invalid arguments to right hand of * operator, need UnityEngine.Vector3!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __DivMeta(RealStatePtr L) + { + + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + if (translator.Assignable(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) + { + UnityEngine.Vector3 leftside;translator.Get(L, 1, out leftside); + float rightside = (float)LuaAPI.lua_tonumber(L, 2); + + translator.PushUnityEngineVector3(L, leftside / rightside); + + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return LuaAPI.luaL_error(L, "invalid arguments to right hand of / operator, need UnityEngine.Vector3!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int __EqMeta(RealStatePtr L) + { + + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + if (translator.Assignable(L, 1) && translator.Assignable(L, 2)) + { + UnityEngine.Vector3 leftside;translator.Get(L, 1, out leftside); + UnityEngine.Vector3 rightside;translator.Get(L, 2, out rightside); + + LuaAPI.lua_pushboolean(L, leftside == rightside); + + return 1; + } + + } + catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return LuaAPI.luaL_error(L, "invalid arguments to right hand of == operator, need UnityEngine.Vector3!"); + + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Slerp_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _a;translator.Get(L, 1, out _a); + UnityEngine.Vector3 _b;translator.Get(L, 2, out _b); + float _t = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Vector3.Slerp( _a, _b, _t ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SlerpUnclamped_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _a;translator.Get(L, 1, out _a); + UnityEngine.Vector3 _b;translator.Get(L, 2, out _b); + float _t = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Vector3.SlerpUnclamped( _a, _b, _t ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_OrthoNormalize_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& translator.Assignable(L, 1)&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _normal;translator.Get(L, 1, out _normal); + UnityEngine.Vector3 _tangent;translator.Get(L, 2, out _tangent); + + UnityEngine.Vector3.OrthoNormalize( ref _normal, ref _tangent ); + translator.PushUnityEngineVector3(L, _normal); + translator.UpdateUnityEngineVector3(L, 1, _normal); + + translator.PushUnityEngineVector3(L, _tangent); + translator.UpdateUnityEngineVector3(L, 2, _tangent); + + + + + return 2; + } + if(gen_param_count == 3&& translator.Assignable(L, 1)&& translator.Assignable(L, 2)&& translator.Assignable(L, 3)) + { + UnityEngine.Vector3 _normal;translator.Get(L, 1, out _normal); + UnityEngine.Vector3 _tangent;translator.Get(L, 2, out _tangent); + UnityEngine.Vector3 _binormal;translator.Get(L, 3, out _binormal); + + UnityEngine.Vector3.OrthoNormalize( ref _normal, ref _tangent, ref _binormal ); + translator.PushUnityEngineVector3(L, _normal); + translator.UpdateUnityEngineVector3(L, 1, _normal); + + translator.PushUnityEngineVector3(L, _tangent); + translator.UpdateUnityEngineVector3(L, 2, _tangent); + + translator.PushUnityEngineVector3(L, _binormal); + translator.UpdateUnityEngineVector3(L, 3, _binormal); + + + + + return 3; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Vector3.OrthoNormalize!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_RotateTowards_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _current;translator.Get(L, 1, out _current); + UnityEngine.Vector3 _target;translator.Get(L, 2, out _target); + float _maxRadiansDelta = (float)LuaAPI.lua_tonumber(L, 3); + float _maxMagnitudeDelta = (float)LuaAPI.lua_tonumber(L, 4); + + var gen_ret = UnityEngine.Vector3.RotateTowards( _current, _target, _maxRadiansDelta, _maxMagnitudeDelta ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Lerp_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _a;translator.Get(L, 1, out _a); + UnityEngine.Vector3 _b;translator.Get(L, 2, out _b); + float _t = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Vector3.Lerp( _a, _b, _t ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_LerpUnclamped_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _a;translator.Get(L, 1, out _a); + UnityEngine.Vector3 _b;translator.Get(L, 2, out _b); + float _t = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Vector3.LerpUnclamped( _a, _b, _t ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_MoveTowards_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _current;translator.Get(L, 1, out _current); + UnityEngine.Vector3 _target;translator.Get(L, 2, out _target); + float _maxDistanceDelta = (float)LuaAPI.lua_tonumber(L, 3); + + var gen_ret = UnityEngine.Vector3.MoveTowards( _current, _target, _maxDistanceDelta ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SmoothDamp_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 4&& translator.Assignable(L, 1)&& translator.Assignable(L, 2)&& translator.Assignable(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) + { + UnityEngine.Vector3 _current;translator.Get(L, 1, out _current); + UnityEngine.Vector3 _target;translator.Get(L, 2, out _target); + UnityEngine.Vector3 _currentVelocity;translator.Get(L, 3, out _currentVelocity); + float _smoothTime = (float)LuaAPI.lua_tonumber(L, 4); + + var gen_ret = UnityEngine.Vector3.SmoothDamp( _current, _target, ref _currentVelocity, _smoothTime ); + translator.PushUnityEngineVector3(L, gen_ret); + translator.PushUnityEngineVector3(L, _currentVelocity); + translator.UpdateUnityEngineVector3(L, 3, _currentVelocity); + + + + + return 2; + } + if(gen_param_count == 5&& translator.Assignable(L, 1)&& translator.Assignable(L, 2)&& translator.Assignable(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5)) + { + UnityEngine.Vector3 _current;translator.Get(L, 1, out _current); + UnityEngine.Vector3 _target;translator.Get(L, 2, out _target); + UnityEngine.Vector3 _currentVelocity;translator.Get(L, 3, out _currentVelocity); + float _smoothTime = (float)LuaAPI.lua_tonumber(L, 4); + float _maxSpeed = (float)LuaAPI.lua_tonumber(L, 5); + + var gen_ret = UnityEngine.Vector3.SmoothDamp( _current, _target, ref _currentVelocity, _smoothTime, _maxSpeed ); + translator.PushUnityEngineVector3(L, gen_ret); + translator.PushUnityEngineVector3(L, _currentVelocity); + translator.UpdateUnityEngineVector3(L, 3, _currentVelocity); + + + + + return 2; + } + if(gen_param_count == 6&& translator.Assignable(L, 1)&& translator.Assignable(L, 2)&& translator.Assignable(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 6)) + { + UnityEngine.Vector3 _current;translator.Get(L, 1, out _current); + UnityEngine.Vector3 _target;translator.Get(L, 2, out _target); + UnityEngine.Vector3 _currentVelocity;translator.Get(L, 3, out _currentVelocity); + float _smoothTime = (float)LuaAPI.lua_tonumber(L, 4); + float _maxSpeed = (float)LuaAPI.lua_tonumber(L, 5); + float _deltaTime = (float)LuaAPI.lua_tonumber(L, 6); + + var gen_ret = UnityEngine.Vector3.SmoothDamp( _current, _target, ref _currentVelocity, _smoothTime, _maxSpeed, _deltaTime ); + translator.PushUnityEngineVector3(L, gen_ret); + translator.PushUnityEngineVector3(L, _currentVelocity); + translator.UpdateUnityEngineVector3(L, 3, _currentVelocity); + + + + + return 2; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Vector3.SmoothDamp!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Set(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + + { + float _newX = (float)LuaAPI.lua_tonumber(L, 2); + float _newY = (float)LuaAPI.lua_tonumber(L, 3); + float _newZ = (float)LuaAPI.lua_tonumber(L, 4); + + gen_to_be_invoked.Set( _newX, _newY, _newZ ); + + + translator.UpdateUnityEngineVector3(L, 1, gen_to_be_invoked); + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Scale_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _a;translator.Get(L, 1, out _a); + UnityEngine.Vector3 _b;translator.Get(L, 2, out _b); + + var gen_ret = UnityEngine.Vector3.Scale( _a, _b ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Scale(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + + { + UnityEngine.Vector3 _scale;translator.Get(L, 2, out _scale); + + gen_to_be_invoked.Scale( _scale ); + + + translator.UpdateUnityEngineVector3(L, 1, gen_to_be_invoked); + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Cross_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _lhs;translator.Get(L, 1, out _lhs); + UnityEngine.Vector3 _rhs;translator.Get(L, 2, out _rhs); + + var gen_ret = UnityEngine.Vector3.Cross( _lhs, _rhs ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_GetHashCode(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + + { + + var gen_ret = gen_to_be_invoked.GetHashCode( ); + LuaAPI.xlua_pushinteger(L, gen_ret); + + + translator.UpdateUnityEngineVector3(L, 1, gen_to_be_invoked); + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Equals(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + object _other = translator.GetObject(L, 2, typeof(object)); + + var gen_ret = gen_to_be_invoked.Equals( _other ); + LuaAPI.lua_pushboolean(L, gen_ret); + + + translator.UpdateUnityEngineVector3(L, 1, gen_to_be_invoked); + + + return 1; + } + if(gen_param_count == 2&& translator.Assignable(L, 2)) + { + UnityEngine.Vector3 _other;translator.Get(L, 2, out _other); + + var gen_ret = gen_to_be_invoked.Equals( _other ); + LuaAPI.lua_pushboolean(L, gen_ret); + + + translator.UpdateUnityEngineVector3(L, 1, gen_to_be_invoked); + + + 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.Vector3.Equals!"); + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Reflect_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _inDirection;translator.Get(L, 1, out _inDirection); + UnityEngine.Vector3 _inNormal;translator.Get(L, 2, out _inNormal); + + var gen_ret = UnityEngine.Vector3.Reflect( _inDirection, _inNormal ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Normalize_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _value;translator.Get(L, 1, out _value); + + var gen_ret = UnityEngine.Vector3.Normalize( _value ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Normalize(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + + { + + gen_to_be_invoked.Normalize( ); + + + translator.UpdateUnityEngineVector3(L, 1, gen_to_be_invoked); + + + return 0; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Dot_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _lhs;translator.Get(L, 1, out _lhs); + UnityEngine.Vector3 _rhs;translator.Get(L, 2, out _rhs); + + var gen_ret = UnityEngine.Vector3.Dot( _lhs, _rhs ); + LuaAPI.lua_pushnumber(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Project_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _vector;translator.Get(L, 1, out _vector); + UnityEngine.Vector3 _onNormal;translator.Get(L, 2, out _onNormal); + + var gen_ret = UnityEngine.Vector3.Project( _vector, _onNormal ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_ProjectOnPlane_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _vector;translator.Get(L, 1, out _vector); + UnityEngine.Vector3 _planeNormal;translator.Get(L, 2, out _planeNormal); + + var gen_ret = UnityEngine.Vector3.ProjectOnPlane( _vector, _planeNormal ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Angle_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _from;translator.Get(L, 1, out _from); + UnityEngine.Vector3 _to;translator.Get(L, 2, out _to); + + var gen_ret = UnityEngine.Vector3.Angle( _from, _to ); + LuaAPI.lua_pushnumber(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SignedAngle_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _from;translator.Get(L, 1, out _from); + UnityEngine.Vector3 _to;translator.Get(L, 2, out _to); + UnityEngine.Vector3 _axis;translator.Get(L, 3, out _axis); + + var gen_ret = UnityEngine.Vector3.SignedAngle( _from, _to, _axis ); + LuaAPI.lua_pushnumber(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Distance_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _a;translator.Get(L, 1, out _a); + UnityEngine.Vector3 _b;translator.Get(L, 2, out _b); + + var gen_ret = UnityEngine.Vector3.Distance( _a, _b ); + LuaAPI.lua_pushnumber(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_ClampMagnitude_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _vector;translator.Get(L, 1, out _vector); + float _maxLength = (float)LuaAPI.lua_tonumber(L, 2); + + var gen_ret = UnityEngine.Vector3.ClampMagnitude( _vector, _maxLength ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Magnitude_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _vector;translator.Get(L, 1, out _vector); + + var gen_ret = UnityEngine.Vector3.Magnitude( _vector ); + LuaAPI.lua_pushnumber(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_SqrMagnitude_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _vector;translator.Get(L, 1, out _vector); + + var gen_ret = UnityEngine.Vector3.SqrMagnitude( _vector ); + LuaAPI.lua_pushnumber(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Min_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _lhs;translator.Get(L, 1, out _lhs); + UnityEngine.Vector3 _rhs;translator.Get(L, 2, out _rhs); + + var gen_ret = UnityEngine.Vector3.Min( _lhs, _rhs ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_Max_xlua_st_(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + + + { + UnityEngine.Vector3 _lhs;translator.Get(L, 1, out _lhs); + UnityEngine.Vector3 _rhs;translator.Get(L, 2, out _rhs); + + var gen_ret = UnityEngine.Vector3.Max( _lhs, _rhs ); + translator.PushUnityEngineVector3(L, gen_ret); + + + + return 1; + } + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _m_ToString(RealStatePtr L) + { + try { + + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + + + int gen_param_count = LuaAPI.lua_gettop(L); + + if(gen_param_count == 1) + { + + var gen_ret = gen_to_be_invoked.ToString( ); + LuaAPI.lua_pushstring(L, gen_ret); + + + translator.UpdateUnityEngineVector3(L, 1, gen_to_be_invoked); + + + return 1; + } + if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) + { + string _format = LuaAPI.lua_tostring(L, 2); + + var gen_ret = gen_to_be_invoked.ToString( _format ); + LuaAPI.lua_pushstring(L, gen_ret); + + + translator.UpdateUnityEngineVector3(L, 1, gen_to_be_invoked); + + + return 1; + } + if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable(L, 3)) + { + string _format = LuaAPI.lua_tostring(L, 2); + System.IFormatProvider _formatProvider = (System.IFormatProvider)translator.GetObject(L, 3, typeof(System.IFormatProvider)); + + var gen_ret = gen_to_be_invoked.ToString( _format, _formatProvider ); + LuaAPI.lua_pushstring(L, gen_ret); + + + translator.UpdateUnityEngineVector3(L, 1, gen_to_be_invoked); + + + 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.Vector3.ToString!"); + + } + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_normalized(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + translator.PushUnityEngineVector3(L, gen_to_be_invoked.normalized); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_magnitude(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked.magnitude); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_sqrMagnitude(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked.sqrMagnitude); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_zero(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineVector3(L, UnityEngine.Vector3.zero); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_one(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineVector3(L, UnityEngine.Vector3.one); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_forward(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineVector3(L, UnityEngine.Vector3.forward); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_back(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineVector3(L, UnityEngine.Vector3.back); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_up(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineVector3(L, UnityEngine.Vector3.up); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_down(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineVector3(L, UnityEngine.Vector3.down); + } 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 { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineVector3(L, UnityEngine.Vector3.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 { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineVector3(L, UnityEngine.Vector3.right); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_positiveInfinity(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineVector3(L, UnityEngine.Vector3.positiveInfinity); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_negativeInfinity(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + translator.PushUnityEngineVector3(L, UnityEngine.Vector3.negativeInfinity); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_x(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked.x); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_y(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked.y); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_z(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + LuaAPI.lua_pushnumber(L, gen_to_be_invoked.z); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_x(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + gen_to_be_invoked.x = (float)LuaAPI.lua_tonumber(L, 2); + + translator.UpdateUnityEngineVector3(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_y(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + gen_to_be_invoked.y = (float)LuaAPI.lua_tonumber(L, 2); + + translator.UpdateUnityEngineVector3(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_z(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + UnityEngine.Vector3 gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); + gen_to_be_invoked.z = (float)LuaAPI.lua_tonumber(L, 2); + + translator.UpdateUnityEngineVector3(L, 1, gen_to_be_invoked); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_Vector3Wrap.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_Vector3Wrap.cs.meta new file mode 100644 index 0000000..686774a --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/UnityEngine_Vector3Wrap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94f170dddb394cd41800c1ab5d94cb06 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/WrapPusher.cs b/ILRuntimeDemo/Assets/XLua/Gen/WrapPusher.cs new file mode 100644 index 0000000..c4a57aa --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/WrapPusher.cs @@ -0,0 +1,883 @@ +#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 System; + + +namespace XLua +{ + public partial class ObjectTranslator + { + + class IniterAdderUnityEngineVector3 + { + static IniterAdderUnityEngineVector3() + { + LuaEnv.AddIniter(Init); + } + + static void Init(LuaEnv luaenv, ObjectTranslator translator) + { + + translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineVector3, translator.Get, translator.UpdateUnityEngineVector3); + translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineQuaternion, translator.Get, translator.UpdateUnityEngineQuaternion); + translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineVector2, translator.Get, translator.UpdateUnityEngineVector2); + translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineVector4, translator.Get, translator.UpdateUnityEngineVector4); + translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineColor, translator.Get, translator.UpdateUnityEngineColor); + translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineRay, translator.Get, translator.UpdateUnityEngineRay); + translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineBounds, translator.Get, translator.UpdateUnityEngineBounds); + translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineRay2D, translator.Get, translator.UpdateUnityEngineRay2D); + translator.RegisterPushAndGetAndUpdate(translator.PushTutorialTestEnum, translator.Get, translator.UpdateTutorialTestEnum); + translator.RegisterPushAndGetAndUpdate(translator.PushTutorialDerivedClassTestEnumInner, translator.Get, translator.UpdateTutorialDerivedClassTestEnumInner); + + } + } + + static IniterAdderUnityEngineVector3 s_IniterAdderUnityEngineVector3_dumb_obj = new IniterAdderUnityEngineVector3(); + static IniterAdderUnityEngineVector3 IniterAdderUnityEngineVector3_dumb_obj {get{return s_IniterAdderUnityEngineVector3_dumb_obj;}} + + + int UnityEngineVector3_TypeID = -1; + public void PushUnityEngineVector3(RealStatePtr L, UnityEngine.Vector3 val) + { + if (UnityEngineVector3_TypeID == -1) + { + bool is_first; + UnityEngineVector3_TypeID = getTypeId(L, typeof(UnityEngine.Vector3), out is_first); + + } + + IntPtr buff = LuaAPI.xlua_pushstruct(L, 12, UnityEngineVector3_TypeID); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail fail for UnityEngine.Vector3 ,value="+val); + } + + } + + public void Get(RealStatePtr L, int index, out UnityEngine.Vector3 val) + { + LuaTypes type = LuaAPI.lua_type(L, index); + if (type == LuaTypes.LUA_TUSERDATA ) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector3_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Vector3"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) + { + throw new Exception("unpack fail for UnityEngine.Vector3"); + } + } + else if (type ==LuaTypes.LUA_TTABLE) + { + CopyByValue.UnPack(this, L, index, out val); + } + else + { + val = (UnityEngine.Vector3)objectCasters.GetCaster(typeof(UnityEngine.Vector3))(L, index, null); + } + } + + public void UpdateUnityEngineVector3(RealStatePtr L, int index, UnityEngine.Vector3 val) + { + + if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector3_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Vector3"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail for UnityEngine.Vector3 ,value="+val); + } + } + + else + { + throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); + } + } + + int UnityEngineQuaternion_TypeID = -1; + public void PushUnityEngineQuaternion(RealStatePtr L, UnityEngine.Quaternion val) + { + if (UnityEngineQuaternion_TypeID == -1) + { + bool is_first; + UnityEngineQuaternion_TypeID = getTypeId(L, typeof(UnityEngine.Quaternion), out is_first); + + } + + IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineQuaternion_TypeID); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail fail for UnityEngine.Quaternion ,value="+val); + } + + } + + public void Get(RealStatePtr L, int index, out UnityEngine.Quaternion val) + { + LuaTypes type = LuaAPI.lua_type(L, index); + if (type == LuaTypes.LUA_TUSERDATA ) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineQuaternion_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Quaternion"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) + { + throw new Exception("unpack fail for UnityEngine.Quaternion"); + } + } + else if (type ==LuaTypes.LUA_TTABLE) + { + CopyByValue.UnPack(this, L, index, out val); + } + else + { + val = (UnityEngine.Quaternion)objectCasters.GetCaster(typeof(UnityEngine.Quaternion))(L, index, null); + } + } + + public void UpdateUnityEngineQuaternion(RealStatePtr L, int index, UnityEngine.Quaternion val) + { + + if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineQuaternion_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Quaternion"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail for UnityEngine.Quaternion ,value="+val); + } + } + + else + { + throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); + } + } + + int UnityEngineVector2_TypeID = -1; + public void PushUnityEngineVector2(RealStatePtr L, UnityEngine.Vector2 val) + { + if (UnityEngineVector2_TypeID == -1) + { + bool is_first; + UnityEngineVector2_TypeID = getTypeId(L, typeof(UnityEngine.Vector2), out is_first); + + } + + IntPtr buff = LuaAPI.xlua_pushstruct(L, 8, UnityEngineVector2_TypeID); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail fail for UnityEngine.Vector2 ,value="+val); + } + + } + + public void Get(RealStatePtr L, int index, out UnityEngine.Vector2 val) + { + LuaTypes type = LuaAPI.lua_type(L, index); + if (type == LuaTypes.LUA_TUSERDATA ) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector2_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Vector2"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) + { + throw new Exception("unpack fail for UnityEngine.Vector2"); + } + } + else if (type ==LuaTypes.LUA_TTABLE) + { + CopyByValue.UnPack(this, L, index, out val); + } + else + { + val = (UnityEngine.Vector2)objectCasters.GetCaster(typeof(UnityEngine.Vector2))(L, index, null); + } + } + + public void UpdateUnityEngineVector2(RealStatePtr L, int index, UnityEngine.Vector2 val) + { + + if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector2_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Vector2"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail for UnityEngine.Vector2 ,value="+val); + } + } + + else + { + throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); + } + } + + int UnityEngineVector4_TypeID = -1; + public void PushUnityEngineVector4(RealStatePtr L, UnityEngine.Vector4 val) + { + if (UnityEngineVector4_TypeID == -1) + { + bool is_first; + UnityEngineVector4_TypeID = getTypeId(L, typeof(UnityEngine.Vector4), out is_first); + + } + + IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineVector4_TypeID); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail fail for UnityEngine.Vector4 ,value="+val); + } + + } + + public void Get(RealStatePtr L, int index, out UnityEngine.Vector4 val) + { + LuaTypes type = LuaAPI.lua_type(L, index); + if (type == LuaTypes.LUA_TUSERDATA ) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector4_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Vector4"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) + { + throw new Exception("unpack fail for UnityEngine.Vector4"); + } + } + else if (type ==LuaTypes.LUA_TTABLE) + { + CopyByValue.UnPack(this, L, index, out val); + } + else + { + val = (UnityEngine.Vector4)objectCasters.GetCaster(typeof(UnityEngine.Vector4))(L, index, null); + } + } + + public void UpdateUnityEngineVector4(RealStatePtr L, int index, UnityEngine.Vector4 val) + { + + if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector4_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Vector4"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail for UnityEngine.Vector4 ,value="+val); + } + } + + else + { + throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); + } + } + + int UnityEngineColor_TypeID = -1; + public void PushUnityEngineColor(RealStatePtr L, UnityEngine.Color val) + { + if (UnityEngineColor_TypeID == -1) + { + bool is_first; + UnityEngineColor_TypeID = getTypeId(L, typeof(UnityEngine.Color), out is_first); + + } + + IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineColor_TypeID); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail fail for UnityEngine.Color ,value="+val); + } + + } + + public void Get(RealStatePtr L, int index, out UnityEngine.Color val) + { + LuaTypes type = LuaAPI.lua_type(L, index); + if (type == LuaTypes.LUA_TUSERDATA ) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineColor_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Color"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) + { + throw new Exception("unpack fail for UnityEngine.Color"); + } + } + else if (type ==LuaTypes.LUA_TTABLE) + { + CopyByValue.UnPack(this, L, index, out val); + } + else + { + val = (UnityEngine.Color)objectCasters.GetCaster(typeof(UnityEngine.Color))(L, index, null); + } + } + + public void UpdateUnityEngineColor(RealStatePtr L, int index, UnityEngine.Color val) + { + + if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineColor_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Color"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail for UnityEngine.Color ,value="+val); + } + } + + else + { + throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); + } + } + + int UnityEngineRay_TypeID = -1; + public void PushUnityEngineRay(RealStatePtr L, UnityEngine.Ray val) + { + if (UnityEngineRay_TypeID == -1) + { + bool is_first; + UnityEngineRay_TypeID = getTypeId(L, typeof(UnityEngine.Ray), out is_first); + + } + + IntPtr buff = LuaAPI.xlua_pushstruct(L, 24, UnityEngineRay_TypeID); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail fail for UnityEngine.Ray ,value="+val); + } + + } + + public void Get(RealStatePtr L, int index, out UnityEngine.Ray val) + { + LuaTypes type = LuaAPI.lua_type(L, index); + if (type == LuaTypes.LUA_TUSERDATA ) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Ray"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) + { + throw new Exception("unpack fail for UnityEngine.Ray"); + } + } + else if (type ==LuaTypes.LUA_TTABLE) + { + CopyByValue.UnPack(this, L, index, out val); + } + else + { + val = (UnityEngine.Ray)objectCasters.GetCaster(typeof(UnityEngine.Ray))(L, index, null); + } + } + + public void UpdateUnityEngineRay(RealStatePtr L, int index, UnityEngine.Ray val) + { + + if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Ray"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail for UnityEngine.Ray ,value="+val); + } + } + + else + { + throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); + } + } + + int UnityEngineBounds_TypeID = -1; + public void PushUnityEngineBounds(RealStatePtr L, UnityEngine.Bounds val) + { + if (UnityEngineBounds_TypeID == -1) + { + bool is_first; + UnityEngineBounds_TypeID = getTypeId(L, typeof(UnityEngine.Bounds), out is_first); + + } + + IntPtr buff = LuaAPI.xlua_pushstruct(L, 24, UnityEngineBounds_TypeID); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail fail for UnityEngine.Bounds ,value="+val); + } + + } + + public void Get(RealStatePtr L, int index, out UnityEngine.Bounds val) + { + LuaTypes type = LuaAPI.lua_type(L, index); + if (type == LuaTypes.LUA_TUSERDATA ) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineBounds_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Bounds"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) + { + throw new Exception("unpack fail for UnityEngine.Bounds"); + } + } + else if (type ==LuaTypes.LUA_TTABLE) + { + CopyByValue.UnPack(this, L, index, out val); + } + else + { + val = (UnityEngine.Bounds)objectCasters.GetCaster(typeof(UnityEngine.Bounds))(L, index, null); + } + } + + public void UpdateUnityEngineBounds(RealStatePtr L, int index, UnityEngine.Bounds val) + { + + if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineBounds_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Bounds"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail for UnityEngine.Bounds ,value="+val); + } + } + + else + { + throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); + } + } + + int UnityEngineRay2D_TypeID = -1; + public void PushUnityEngineRay2D(RealStatePtr L, UnityEngine.Ray2D val) + { + if (UnityEngineRay2D_TypeID == -1) + { + bool is_first; + UnityEngineRay2D_TypeID = getTypeId(L, typeof(UnityEngine.Ray2D), out is_first); + + } + + IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineRay2D_TypeID); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail fail for UnityEngine.Ray2D ,value="+val); + } + + } + + public void Get(RealStatePtr L, int index, out UnityEngine.Ray2D val) + { + LuaTypes type = LuaAPI.lua_type(L, index); + if (type == LuaTypes.LUA_TUSERDATA ) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay2D_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Ray2D"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) + { + throw new Exception("unpack fail for UnityEngine.Ray2D"); + } + } + else if (type ==LuaTypes.LUA_TTABLE) + { + CopyByValue.UnPack(this, L, index, out val); + } + else + { + val = (UnityEngine.Ray2D)objectCasters.GetCaster(typeof(UnityEngine.Ray2D))(L, index, null); + } + } + + public void UpdateUnityEngineRay2D(RealStatePtr L, int index, UnityEngine.Ray2D val) + { + + if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) + { + if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay2D_TypeID) + { + throw new Exception("invalid userdata for UnityEngine.Ray2D"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + if (!CopyByValue.Pack(buff, 0, val)) + { + throw new Exception("pack fail for UnityEngine.Ray2D ,value="+val); + } + } + + else + { + throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); + } + } + + int TutorialTestEnum_TypeID = -1; + int TutorialTestEnum_EnumRef = -1; + + public void PushTutorialTestEnum(RealStatePtr L, Tutorial.TestEnum val) + { + if (TutorialTestEnum_TypeID == -1) + { + bool is_first; + TutorialTestEnum_TypeID = getTypeId(L, typeof(Tutorial.TestEnum), out is_first); + + if (TutorialTestEnum_EnumRef == -1) + { + Utils.LoadCSTable(L, typeof(Tutorial.TestEnum)); + TutorialTestEnum_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX); + } + + } + + if (LuaAPI.xlua_tryget_cachedud(L, (int)val, TutorialTestEnum_EnumRef) == 1) + { + return; + } + + IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, TutorialTestEnum_TypeID); + if (!CopyByValue.Pack(buff, 0, (int)val)) + { + throw new Exception("pack fail fail for Tutorial.TestEnum ,value="+val); + } + + LuaAPI.lua_getref(L, TutorialTestEnum_EnumRef); + LuaAPI.lua_pushvalue(L, -2); + LuaAPI.xlua_rawseti(L, -2, (int)val); + LuaAPI.lua_pop(L, 1); + + } + + public void Get(RealStatePtr L, int index, out Tutorial.TestEnum val) + { + LuaTypes type = LuaAPI.lua_type(L, index); + if (type == LuaTypes.LUA_TUSERDATA ) + { + if (LuaAPI.xlua_gettypeid(L, index) != TutorialTestEnum_TypeID) + { + throw new Exception("invalid userdata for Tutorial.TestEnum"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + int e; + if (!CopyByValue.UnPack(buff, 0, out e)) + { + throw new Exception("unpack fail for Tutorial.TestEnum"); + } + val = (Tutorial.TestEnum)e; + + } + else + { + val = (Tutorial.TestEnum)objectCasters.GetCaster(typeof(Tutorial.TestEnum))(L, index, null); + } + } + + public void UpdateTutorialTestEnum(RealStatePtr L, int index, Tutorial.TestEnum val) + { + + if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) + { + if (LuaAPI.xlua_gettypeid(L, index) != TutorialTestEnum_TypeID) + { + throw new Exception("invalid userdata for Tutorial.TestEnum"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + if (!CopyByValue.Pack(buff, 0, (int)val)) + { + throw new Exception("pack fail for Tutorial.TestEnum ,value="+val); + } + } + + else + { + throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); + } + } + + int TutorialDerivedClassTestEnumInner_TypeID = -1; + int TutorialDerivedClassTestEnumInner_EnumRef = -1; + + public void PushTutorialDerivedClassTestEnumInner(RealStatePtr L, Tutorial.DerivedClass.TestEnumInner val) + { + if (TutorialDerivedClassTestEnumInner_TypeID == -1) + { + bool is_first; + TutorialDerivedClassTestEnumInner_TypeID = getTypeId(L, typeof(Tutorial.DerivedClass.TestEnumInner), out is_first); + + if (TutorialDerivedClassTestEnumInner_EnumRef == -1) + { + Utils.LoadCSTable(L, typeof(Tutorial.DerivedClass.TestEnumInner)); + TutorialDerivedClassTestEnumInner_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX); + } + + } + + if (LuaAPI.xlua_tryget_cachedud(L, (int)val, TutorialDerivedClassTestEnumInner_EnumRef) == 1) + { + return; + } + + IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, TutorialDerivedClassTestEnumInner_TypeID); + if (!CopyByValue.Pack(buff, 0, (int)val)) + { + throw new Exception("pack fail fail for Tutorial.DerivedClass.TestEnumInner ,value="+val); + } + + LuaAPI.lua_getref(L, TutorialDerivedClassTestEnumInner_EnumRef); + LuaAPI.lua_pushvalue(L, -2); + LuaAPI.xlua_rawseti(L, -2, (int)val); + LuaAPI.lua_pop(L, 1); + + } + + public void Get(RealStatePtr L, int index, out Tutorial.DerivedClass.TestEnumInner val) + { + LuaTypes type = LuaAPI.lua_type(L, index); + if (type == LuaTypes.LUA_TUSERDATA ) + { + if (LuaAPI.xlua_gettypeid(L, index) != TutorialDerivedClassTestEnumInner_TypeID) + { + throw new Exception("invalid userdata for Tutorial.DerivedClass.TestEnumInner"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + int e; + if (!CopyByValue.UnPack(buff, 0, out e)) + { + throw new Exception("unpack fail for Tutorial.DerivedClass.TestEnumInner"); + } + val = (Tutorial.DerivedClass.TestEnumInner)e; + + } + else + { + val = (Tutorial.DerivedClass.TestEnumInner)objectCasters.GetCaster(typeof(Tutorial.DerivedClass.TestEnumInner))(L, index, null); + } + } + + public void UpdateTutorialDerivedClassTestEnumInner(RealStatePtr L, int index, Tutorial.DerivedClass.TestEnumInner val) + { + + if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) + { + if (LuaAPI.xlua_gettypeid(L, index) != TutorialDerivedClassTestEnumInner_TypeID) + { + throw new Exception("invalid userdata for Tutorial.DerivedClass.TestEnumInner"); + } + + IntPtr buff = LuaAPI.lua_touserdata(L, index); + if (!CopyByValue.Pack(buff, 0, (int)val)) + { + throw new Exception("pack fail for Tutorial.DerivedClass.TestEnumInner ,value="+val); + } + } + + else + { + throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); + } + } + + + // table cast optimze + + + } + + public partial class StaticLuaCallbacks + { + internal static bool __tryArrayGet(Type type, RealStatePtr L, ObjectTranslator translator, object obj, int index) + { + + if (type == typeof(UnityEngine.Vector3[])) + { + UnityEngine.Vector3[] array = obj as UnityEngine.Vector3[]; + translator.PushUnityEngineVector3(L, array[index]); + return true; + } + else if (type == typeof(UnityEngine.Quaternion[])) + { + UnityEngine.Quaternion[] array = obj as UnityEngine.Quaternion[]; + translator.PushUnityEngineQuaternion(L, array[index]); + return true; + } + else if (type == typeof(UnityEngine.Vector2[])) + { + UnityEngine.Vector2[] array = obj as UnityEngine.Vector2[]; + translator.PushUnityEngineVector2(L, array[index]); + return true; + } + else if (type == typeof(UnityEngine.Vector4[])) + { + UnityEngine.Vector4[] array = obj as UnityEngine.Vector4[]; + translator.PushUnityEngineVector4(L, array[index]); + return true; + } + else if (type == typeof(UnityEngine.Color[])) + { + UnityEngine.Color[] array = obj as UnityEngine.Color[]; + translator.PushUnityEngineColor(L, array[index]); + return true; + } + else if (type == typeof(UnityEngine.Ray[])) + { + UnityEngine.Ray[] array = obj as UnityEngine.Ray[]; + translator.PushUnityEngineRay(L, array[index]); + return true; + } + else if (type == typeof(UnityEngine.Bounds[])) + { + UnityEngine.Bounds[] array = obj as UnityEngine.Bounds[]; + translator.PushUnityEngineBounds(L, array[index]); + return true; + } + else if (type == typeof(UnityEngine.Ray2D[])) + { + UnityEngine.Ray2D[] array = obj as UnityEngine.Ray2D[]; + translator.PushUnityEngineRay2D(L, array[index]); + return true; + } + else if (type == typeof(Tutorial.TestEnum[])) + { + Tutorial.TestEnum[] array = obj as Tutorial.TestEnum[]; + translator.PushTutorialTestEnum(L, array[index]); + return true; + } + else if (type == typeof(Tutorial.DerivedClass.TestEnumInner[])) + { + Tutorial.DerivedClass.TestEnumInner[] array = obj as Tutorial.DerivedClass.TestEnumInner[]; + translator.PushTutorialDerivedClassTestEnumInner(L, array[index]); + return true; + } + return false; + } + + internal static bool __tryArraySet(Type type, RealStatePtr L, ObjectTranslator translator, object obj, int array_idx, int obj_idx) + { + + if (type == typeof(UnityEngine.Vector3[])) + { + UnityEngine.Vector3[] array = obj as UnityEngine.Vector3[]; + translator.Get(L, obj_idx, out array[array_idx]); + return true; + } + else if (type == typeof(UnityEngine.Quaternion[])) + { + UnityEngine.Quaternion[] array = obj as UnityEngine.Quaternion[]; + translator.Get(L, obj_idx, out array[array_idx]); + return true; + } + else if (type == typeof(UnityEngine.Vector2[])) + { + UnityEngine.Vector2[] array = obj as UnityEngine.Vector2[]; + translator.Get(L, obj_idx, out array[array_idx]); + return true; + } + else if (type == typeof(UnityEngine.Vector4[])) + { + UnityEngine.Vector4[] array = obj as UnityEngine.Vector4[]; + translator.Get(L, obj_idx, out array[array_idx]); + return true; + } + else if (type == typeof(UnityEngine.Color[])) + { + UnityEngine.Color[] array = obj as UnityEngine.Color[]; + translator.Get(L, obj_idx, out array[array_idx]); + return true; + } + else if (type == typeof(UnityEngine.Ray[])) + { + UnityEngine.Ray[] array = obj as UnityEngine.Ray[]; + translator.Get(L, obj_idx, out array[array_idx]); + return true; + } + else if (type == typeof(UnityEngine.Bounds[])) + { + UnityEngine.Bounds[] array = obj as UnityEngine.Bounds[]; + translator.Get(L, obj_idx, out array[array_idx]); + return true; + } + else if (type == typeof(UnityEngine.Ray2D[])) + { + UnityEngine.Ray2D[] array = obj as UnityEngine.Ray2D[]; + translator.Get(L, obj_idx, out array[array_idx]); + return true; + } + else if (type == typeof(Tutorial.TestEnum[])) + { + Tutorial.TestEnum[] array = obj as Tutorial.TestEnum[]; + translator.Get(L, obj_idx, out array[array_idx]); + return true; + } + else if (type == typeof(Tutorial.DerivedClass.TestEnumInner[])) + { + Tutorial.DerivedClass.TestEnumInner[] array = obj as Tutorial.DerivedClass.TestEnumInner[]; + translator.Get(L, obj_idx, out array[array_idx]); + return true; + } + return false; + } + } +} \ No newline at end of file diff --git a/ILRuntimeDemo/Assets/XLua/Gen/WrapPusher.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/WrapPusher.cs.meta new file mode 100644 index 0000000..8308187 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/WrapPusher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e14511c44ab7c7e4b847b58d7d66420a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/XLuaGenAutoRegister.cs b/ILRuntimeDemo/Assets/XLua/Gen/XLuaGenAutoRegister.cs new file mode 100644 index 0000000..d584224 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/XLuaGenAutoRegister.cs @@ -0,0 +1,110 @@ +#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 System; +using System.Collections.Generic; +using System.Reflection; + + +namespace XLua.CSObjectWrap +{ + public class XLua_Gen_Initer_Register__ + { + + + static void wrapInit0(LuaEnv luaenv, ObjectTranslator translator) + { + + translator.DelayWrapLoader(typeof(Performance), PerformanceWrap.__Register); + + + translator.DelayWrapLoader(typeof(TransformUtil), TransformUtilWrap.__Register); + + + translator.DelayWrapLoader(typeof(UnityEngine.GameObject), UnityEngineGameObjectWrap.__Register); + + + translator.DelayWrapLoader(typeof(UnityEngine.Transform), UnityEngineTransformWrap.__Register); + + + translator.DelayWrapLoader(typeof(UnityEngine.Vector3), UnityEngineVector3Wrap.__Register); + + + translator.DelayWrapLoader(typeof(UnityEngine.Quaternion), UnityEngineQuaternionWrap.__Register); + + + translator.DelayWrapLoader(typeof(Tutorial.BaseClass), TutorialBaseClassWrap.__Register); + + + translator.DelayWrapLoader(typeof(Tutorial.TestEnum), TutorialTestEnumWrap.__Register); + + + translator.DelayWrapLoader(typeof(Tutorial.DerivedClass), TutorialDerivedClassWrap.__Register); + + + translator.DelayWrapLoader(typeof(Tutorial.ICalc), TutorialICalcWrap.__Register); + + + translator.DelayWrapLoader(typeof(Tutorial.DerivedClassExtensions), TutorialDerivedClassExtensionsWrap.__Register); + + + translator.DelayWrapLoader(typeof(XLuaTest.LuaBehaviour), XLuaTestLuaBehaviourWrap.__Register); + + + translator.DelayWrapLoader(typeof(Tutorial.DerivedClass.TestEnumInner), TutorialDerivedClassTestEnumInnerWrap.__Register); + + + + } + + static void Init(LuaEnv luaenv, ObjectTranslator translator) + { + + wrapInit0(luaenv, translator); + + + translator.AddInterfaceBridgeCreator(typeof(System.Collections.IEnumerator), SystemCollectionsIEnumeratorBridge.__Create); + + translator.AddInterfaceBridgeCreator(typeof(Tutorial.CSCallLua.ItfD), TutorialCSCallLuaItfDBridge.__Create); + + } + + static XLua_Gen_Initer_Register__() + { + XLua.LuaEnv.AddIniter(Init); + } + + + } + +} +namespace XLua +{ + public partial class ObjectTranslator + { + static XLua.CSObjectWrap.XLua_Gen_Initer_Register__ s_gen_reg_dumb_obj = new XLua.CSObjectWrap.XLua_Gen_Initer_Register__(); + static XLua.CSObjectWrap.XLua_Gen_Initer_Register__ gen_reg_dumb_obj {get{return s_gen_reg_dumb_obj;}} + } + + internal partial class InternalGlobals + { + + static InternalGlobals() + { + extensionMethodMap = new Dictionary>() + { + + }; + + genTryArrayGetPtr = StaticLuaCallbacks.__tryArrayGet; + genTryArraySetPtr = StaticLuaCallbacks.__tryArraySet; + } + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/XLuaGenAutoRegister.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/XLuaGenAutoRegister.cs.meta new file mode 100644 index 0000000..fc5b34e --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/XLuaGenAutoRegister.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e7a32b142a15194b9603449d9833fc4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/XLuaTest_LuaBehaviourWrap.cs b/ILRuntimeDemo/Assets/XLua/Gen/XLuaTest_LuaBehaviourWrap.cs new file mode 100644 index 0000000..f8c1c27 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/XLuaTest_LuaBehaviourWrap.cs @@ -0,0 +1,146 @@ +#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 XLuaTestLuaBehaviourWrap + { + public static void __Register(RealStatePtr L) + { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + System.Type type = typeof(XLuaTest.LuaBehaviour); + Utils.BeginObjectRegister(type, L, translator, 0, 0, 2, 2); + + + + Utils.RegisterFunc(L, Utils.GETTER_IDX, "luaScript", _g_get_luaScript); + Utils.RegisterFunc(L, Utils.GETTER_IDX, "injections", _g_get_injections); + + Utils.RegisterFunc(L, Utils.SETTER_IDX, "luaScript", _s_set_luaScript); + Utils.RegisterFunc(L, Utils.SETTER_IDX, "injections", _s_set_injections); + + + 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) == 1) + { + + var gen_ret = new XLuaTest.LuaBehaviour(); + 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 XLuaTest.LuaBehaviour constructor!"); + + } + + + + + + + + + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_luaScript(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + XLuaTest.LuaBehaviour gen_to_be_invoked = (XLuaTest.LuaBehaviour)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.luaScript); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _g_get_injections(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + XLuaTest.LuaBehaviour gen_to_be_invoked = (XLuaTest.LuaBehaviour)translator.FastGetCSObj(L, 1); + translator.Push(L, gen_to_be_invoked.injections); + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 1; + } + + + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_luaScript(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + XLuaTest.LuaBehaviour gen_to_be_invoked = (XLuaTest.LuaBehaviour)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.luaScript = (UnityEngine.TextAsset)translator.GetObject(L, 2, typeof(UnityEngine.TextAsset)); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] + static int _s_set_injections(RealStatePtr L) + { + try { + ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); + + XLuaTest.LuaBehaviour gen_to_be_invoked = (XLuaTest.LuaBehaviour)translator.FastGetCSObj(L, 1); + gen_to_be_invoked.injections = (XLuaTest.Injection[])translator.GetObject(L, 2, typeof(XLuaTest.Injection[])); + + } catch(System.Exception gen_e) { + return LuaAPI.luaL_error(L, "c# exception:" + gen_e); + } + return 0; + } + + + + + + } +} diff --git a/ILRuntimeDemo/Assets/XLua/Gen/XLuaTest_LuaBehaviourWrap.cs.meta b/ILRuntimeDemo/Assets/XLua/Gen/XLuaTest_LuaBehaviourWrap.cs.meta new file mode 100644 index 0000000..ff5aab2 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/XLuaTest_LuaBehaviourWrap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac39b039b8f48d648a9204b06f0c4a88 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ILRuntimeDemo/Assets/XLua/Gen/link.xml b/ILRuntimeDemo/Assets/XLua/Gen/link.xml new file mode 100644 index 0000000..3ba58f7 --- /dev/null +++ b/ILRuntimeDemo/Assets/XLua/Gen/link.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ILRuntimeDemo/Assets/StreamingAssets/HotFix_Project.dll.mdb.meta b/ILRuntimeDemo/Assets/XLua/Gen/link.xml.meta similarity index 62% rename from ILRuntimeDemo/Assets/StreamingAssets/HotFix_Project.dll.mdb.meta rename to ILRuntimeDemo/Assets/XLua/Gen/link.xml.meta index b00590c..3129762 100644 --- a/ILRuntimeDemo/Assets/StreamingAssets/HotFix_Project.dll.mdb.meta +++ b/ILRuntimeDemo/Assets/XLua/Gen/link.xml.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: d320c99c928aa3643a57dddcbde300a5 -DefaultImporter: +guid: fabe6754bc360b24cbb0d98ed34d4cdc +TextScriptImporter: externalObjects: {} userData: assetBundleName: diff --git a/ILRuntimeDemo/Assets/XLua/Src/Editor/Generator.cs b/ILRuntimeDemo/Assets/XLua/Src/Editor/Generator.cs index 632757c..669b8c4 100644 --- a/ILRuntimeDemo/Assets/XLua/Src/Editor/Generator.cs +++ b/ILRuntimeDemo/Assets/XLua/Src/Editor/Generator.cs @@ -1323,7 +1323,7 @@ static void AddToList(List list, Func get, object attr) { foreach(var type in (obj as IEnumerable)) { - OptimizeCfg.Add(type, flag); + OptimizeCfg[type] = flag; } } }