Browse Source

Remove: libraries

AnnulusGames 11 months ago
parent
commit
e81e44585b

+ 0 - 128
src/Lua.Unity/Assets/Lua.Unity/Runtime/ColorLibrary.cs

@@ -1,128 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using Lua.Runtime;
-using UnityEngine;
-
-namespace Lua.Unity
-{
-    public sealed class ColorLibrary
-    {
-        public static readonly ColorLibrary Instance = new();
-
-        public readonly LuaFunction[] Functions;
-        public readonly LuaTable Metatable = new();
-
-        public ColorLibrary()
-        {
-            Functions = new LuaFunction[]
-            {
-                new("hsv_to_rgb", HSVToRGB),
-                new("rgb_to_hsv", RGBToHSV),
-            };
-
-            Metatable[Metamethods.Index] = new LuaFunction((context, buffer, ct) =>
-            {
-                var name = context.GetArgument<string>(1);
-                buffer.Span[0] = name switch
-                {
-                    "black" => new LuaColor(Color.black),
-                    "blue" => new LuaColor(Color.blue),
-                    "clear" => new LuaColor(Color.clear),
-                    "cyan" => new LuaColor(Color.cyan),
-                    "gray" => new LuaColor(Color.gray),
-                    "green" => new LuaColor(Color.green),
-                    "magenta" => new LuaColor(Color.magenta),
-                    "red" => new LuaColor(Color.red),
-                    "white" => new LuaColor(Color.white),
-                    "yellow" => new LuaColor(Color.yellow),
-                    _ => LuaValue.Nil,
-                };
-                return new(1);
-            });
-        }
-
-        public static ValueTask<int> HSVToRGB(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var h = context.GetArgument<float>(0);
-            var s = context.GetArgument<float>(1);
-            var v = context.GetArgument<float>(2);
-            var hdr = context.HasArgument(3)
-                ? context.GetArgument<bool>(3)
-                : false;
-
-            buffer.Span[0] = new LuaColor(Color.HSVToRGB(h, s, v, hdr));
-            return new(1);
-        }
-
-        public static ValueTask<int> RGBToHSV(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var color = context.GetArgument<LuaColor>(0);
-            Color.RGBToHSV(color, out var h, out var s, out var v);
-            buffer.Span[0] = h;
-            buffer.Span[1] = s;
-            buffer.Span[2] = v;
-            return new(3);
-        }
-    }
-
-    [LuaObject]
-    public sealed partial class LuaColor
-    {
-        Color value;
-
-        public LuaColor(Color color)
-        {
-            value = color;
-        }
-
-        public LuaColor(float r, float g, float b, float a)
-        {
-            value = new(r, g, b, a);
-        }
-
-        [LuaMember("r")]
-        public float R
-        {
-            get => value.r;
-            set => this.value.r = value;
-        }
-
-        [LuaMember("g")]
-        public float G
-        {
-            get => value.g;
-            set => this.value.g = value;
-        }
-
-        [LuaMember("b")]
-        public float B
-        {
-            get => value.b;
-            set => this.value.b = value;
-        }
-
-        [LuaMember("a")]
-        public float A
-        {
-            get => value.a;
-            set => this.value.a = value;
-        }
-
-        [LuaMetamethod(LuaObjectMetamethod.ToString)]
-        public override string ToString()
-        {
-            return value.ToString();
-        }
-
-        public static implicit operator Color(LuaColor color)
-        {
-            return new Color(color.R, color.G, color.B, color.A);
-        }
-
-        public static implicit operator LuaColor(Color color)
-        {
-            return new LuaColor(color);
-        }
-    }
-}

+ 0 - 38
src/Lua.Unity/Assets/Lua.Unity/Runtime/LuaStateExtensions.cs

@@ -1,38 +0,0 @@
-namespace Lua.Unity
-{
-    public static class LuaStateExtensions
-    {
-        public static void OpenUnityLibraries(this LuaState state)
-        {
-            var vector2 = new LuaTable(0, Vector2Library.Instance.Functions.Length);
-            foreach (var func in Vector2Library.Instance.Functions)
-            {
-                vector2[func.Name] = func;
-            }
-            vector2.Metatable = Vector2Library.Instance.Metatable;
-            state.Environment["vector2"] = vector2;
-
-            var vector3 = new LuaTable(0, Vector3Library.Instance.Functions.Length);
-            foreach (var func in Vector3Library.Instance.Functions)
-            {
-                vector3[func.Name] = func;
-            }
-            vector3.Metatable = Vector3Library.Instance.Metatable;
-            state.Environment["vector3"] = vector3;
-
-            var color = new LuaTable(0, ColorLibrary.Instance.Functions.Length);
-            foreach (var func in ColorLibrary.Instance.Functions)
-            {
-                color[func.Name] = func;
-            }
-            color.Metatable = ColorLibrary.Instance.Metatable;
-            state.Environment["color"] = color;
-
-            var time = new LuaTable
-            {
-                Metatable = TimeLibrary.Instance.Metatable
-            };
-            state.Environment["time"] = time;
-        }
-    }
-}

+ 0 - 49
src/Lua.Unity/Assets/Lua.Unity/Runtime/TimeLibrary.cs

@@ -1,49 +0,0 @@
-using Lua.Runtime;
-using UnityEngine;
-
-namespace Lua.Unity
-{
-    public sealed class TimeLibrary
-    {
-        public static readonly TimeLibrary Instance = new();
-
-        public readonly LuaTable Metatable = new();
-
-        public TimeLibrary()
-        {
-            Metatable[Metamethods.Index] = new LuaFunction((context, buffer, ct) =>
-            {
-                var name = context.GetArgument<string>(1);
-                buffer.Span[0] = name switch
-                {
-                    "time" => Time.timeAsDouble,
-                    "unscaled_time" => Time.unscaledTimeAsDouble,
-                    "delta_time" => Time.deltaTime,
-                    "unscaled_delta_time" => Time.unscaledDeltaTime,
-                    "fixed_time" => Time.fixedTimeAsDouble,
-                    "fixed_unscaled_time" => Time.fixedUnscaledTimeAsDouble,
-                    "fixed_delta_time" => Time.fixedDeltaTime,
-                    "fixed_unscaled_delta_time" => Time.fixedUnscaledDeltaTime,
-                    "time_since_level_load" => Time.timeSinceLevelLoadAsDouble,
-                    "in_fixed_time_step" => Time.inFixedTimeStep,
-                    "frame_count" => Time.frameCount,
-                    "time_scale" => Time.timeScale,
-                    _ => LuaValue.Nil,
-                };
-                return new(1);
-            });
-
-            Metatable[Metamethods.NewIndex] = new LuaFunction((context, buffer, ct) =>
-            {
-                var name = context.GetArgument<string>(1);
-                switch (name)
-                {
-                    case "time_scale":
-                        Time.timeScale = context.GetArgument<float>(2);
-                        break;
-                }
-                return new(0);
-            });
-        }
-    }
-}

+ 0 - 219
src/Lua.Unity/Assets/Lua.Unity/Runtime/Vector2Library.cs

@@ -1,219 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using Lua.Runtime;
-using UnityEngine;
-
-namespace Lua.Unity
-{
-    public sealed class Vector2Library
-    {
-        public static readonly Vector2Library Instance = new();
-
-        public readonly LuaFunction[] Functions;
-        public readonly LuaTable Metatable = new();
-
-        public Vector2Library()
-        {
-            Functions = new LuaFunction[]
-            {
-                new("angle", Angle),
-                new("distance", Distance),
-                new("dot", Dot),
-                new("lerp", Lerp),
-                new("lerp_unclamped", LerpUnclamped),
-                new("max", Max),
-                new("min", Min),
-                new("move_towards", MoveTowards),
-                new("reflect", Reflect),
-                new("scale", Scale),
-                new("signed_angle", SignedAngle),
-            };
-
-            Metatable[Metamethods.Index] = new LuaFunction((context, buffer, ct) =>
-            {
-                var name = context.GetArgument<string>(1);
-                buffer.Span[0] = name switch
-                {
-                    "zero" => new LuaVector2(Vector2.zero),
-                    "one" => new LuaVector2(Vector2.one),
-                    "right" => new LuaVector2(Vector2.right),
-                    "left" => new LuaVector2(Vector2.left),
-                    "up" => new LuaVector2(Vector2.up),
-                    "down" => new LuaVector2(Vector2.down),
-                    _ => LuaValue.Nil,
-                };
-                return new(1);
-            });
-        }
-
-        public ValueTask<int> Angle(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector2>(0);
-            var b = context.GetArgument<LuaVector2>(1);
-            buffer.Span[0] = Vector2.Angle(a, b);
-            return new(1);
-        }
-        public ValueTask<int> Distance(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector2>(0);
-            var b = context.GetArgument<LuaVector2>(1);
-            buffer.Span[0] = Vector2.Distance(a, b);
-            return new(1);
-        }
-
-        public ValueTask<int> Dot(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector2>(0);
-            var b = context.GetArgument<LuaVector2>(1);
-            buffer.Span[0] = Vector2.Dot(a, b);
-            return new(1);
-        }
-
-        public ValueTask<int> Lerp(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector2>(0);
-            var b = context.GetArgument<LuaVector2>(1);
-            var t = context.GetArgument<float>(2);
-            buffer.Span[0] = new LuaVector2(Vector2.Lerp(a, b, t));
-            return new(1);
-        }
-
-        public ValueTask<int> LerpUnclamped(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector2>(0);
-            var b = context.GetArgument<LuaVector2>(1);
-            var t = context.GetArgument<float>(2);
-            buffer.Span[0] = new LuaVector2(Vector2.LerpUnclamped(a, b, t));
-            return new(1);
-        }
-
-        public ValueTask<int> Max(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector2>(0);
-            var b = context.GetArgument<LuaVector2>(1);
-            buffer.Span[0] = new LuaVector2(Vector2.Max(a, b));
-            return new(1);
-        }
-
-        public ValueTask<int> Min(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector2>(0);
-            var b = context.GetArgument<LuaVector2>(1);
-            buffer.Span[0] = new LuaVector2(Vector2.Min(a, b));
-            return new(1);
-        }
-
-        public ValueTask<int> MoveTowards(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector2>(0);
-            var b = context.GetArgument<LuaVector2>(1);
-            var t = context.GetArgument<float>(2);
-            buffer.Span[0] = new LuaVector2(Vector2.MoveTowards(a, b, t));
-            return new(1);
-        }
-
-        public ValueTask<int> Reflect(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var inDirection = context.GetArgument<LuaVector2>(0);
-            var inNormal = context.GetArgument<LuaVector2>(1);
-            buffer.Span[0] = new LuaVector2(Vector2.Reflect(inDirection, inNormal));
-            return new(1);
-        }
-
-        public ValueTask<int> Scale(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector2>(0);
-            var b = context.GetArgument<LuaVector2>(1);
-            buffer.Span[0] = new LuaVector2(Vector2.Scale(a, b));
-            return new(1);
-        }
-
-        public ValueTask<int> SignedAngle(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var from = context.GetArgument<LuaVector2>(0);
-            var to = context.GetArgument<LuaVector2>(1);
-            buffer.Span[0] = Vector2.SignedAngle(from, to);
-            return new(1);
-        }
-    }
-
-    [LuaObject]
-    public sealed partial class LuaVector2
-    {
-        Vector2 value;
-
-        [LuaMember("x")]
-        public float X
-        {
-            get => value.x;
-            set => this.value.x = value;
-        }
-
-        [LuaMember("y")]
-        public float Y
-        {
-            get => value.y;
-            set => this.value.y = value;
-        }
-
-        public LuaVector2(float x, float y)
-        {
-            value = new Vector2(x, y);
-        }
-
-        public LuaVector2(Vector2 vector2)
-        {
-            value = vector2;
-        }
-
-        [LuaMember("normalized")]
-        public LuaVector2 Normalized() => new(value.normalized);
-
-        [LuaMember("magnitude")]
-        public float Magnitude() => value.magnitude;
-
-        [LuaMember("sqrmagnitude")]
-        public float SqrMagnitude() => value.sqrMagnitude;
-
-        [LuaMetamethod(LuaObjectMetamethod.Add)]
-        public static LuaVector2 Add(LuaVector2 a, LuaVector2 b)
-        {
-            return new(a.X + b.X, a.Y + b.Y);
-        }
-
-        [LuaMetamethod(LuaObjectMetamethod.Sub)]
-        public static LuaVector2 Sub(LuaVector2 a, LuaVector2 b)
-        {
-            return new(a.X - b.X, a.Y - b.Y);
-        }
-
-        [LuaMetamethod(LuaObjectMetamethod.Mul)]
-        public static LuaVector2 Mul(LuaVector2 a, float b)
-        {
-            return new(a.X * b, a.Y * b);
-        }
-
-        [LuaMetamethod(LuaObjectMetamethod.Div)]
-        public static LuaVector2 Div(LuaVector2 a, float b)
-        {
-            return new(a.X / b, a.Y / b);
-        }
-
-        [LuaMetamethod(LuaObjectMetamethod.ToString)]
-        public override string ToString()
-        {
-            return value.ToString();
-        }
-
-        public static implicit operator Vector2(LuaVector2 luaVector2)
-        {
-            return new Vector2(luaVector2.X, luaVector2.Y);
-        }
-
-        public static implicit operator LuaVector2(Vector2 luaVector2)
-        {
-            return new LuaVector2(luaVector2.x, luaVector2.y);
-        }
-    }
-}

+ 0 - 288
src/Lua.Unity/Assets/Lua.Unity/Runtime/Vector3Library.cs

@@ -1,288 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using Lua.Runtime;
-using UnityEngine;
-
-namespace Lua.Unity
-{
-    public sealed class Vector3Library
-    {
-        public static readonly Vector3Library Instance = new();
-
-        public readonly LuaFunction[] Functions;
-        public readonly LuaTable Metatable = new();
-
-        public Vector3Library()
-        {
-            Functions = new LuaFunction[]
-            {
-                new("angle", Angle),
-                new("cross", Cross),
-                new("distance", Distance),
-                new("dot", Dot),
-                new("lerp", Lerp),
-                new("lerp_unclamped", LerpUnclamped),
-                new("max", Max),
-                new("min", Min),
-                new("move_towards", MoveTowards),
-                new("project", Project),
-                new("project_on_plane", ProjectOnPlane),
-                new("reflect", Reflect),
-                new("rotate_towards", RotateTowards),
-                new("scale", Scale),
-                new("signed_angle", SignedAngle),
-                new("slerp", Slerp),
-                new("slerp_unclamped", SlerpUnclamped),
-            };
-
-            Metatable[Metamethods.Index] = new LuaFunction((context, buffer, ct) =>
-            {
-                var name = context.GetArgument<string>(1);
-                buffer.Span[0] = name switch
-                {
-                    "zero" => new LuaVector3(Vector3.zero),
-                    "one" => new LuaVector3(Vector3.one),
-                    "right" => new LuaVector3(Vector2.right),
-                    "left" => new LuaVector3(Vector3.left),
-                    "up" => new LuaVector3(Vector3.up),
-                    "down" => new LuaVector3(Vector3.down),
-                    "forward" => new LuaVector3(Vector3.forward),
-                    "back" => new LuaVector3(Vector3.back),
-                    _ => LuaValue.Nil,
-                };
-                return new(1);
-            });
-        }
-
-        public ValueTask<int> Angle(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            buffer.Span[0] = Vector3.Angle(a, b);
-            return new(1);
-        }
-
-        public ValueTask<int> Cross(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            buffer.Span[0] = new LuaVector3(Vector3.Cross(a, b));
-            return new(1);
-        }
-
-        public ValueTask<int> Distance(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            buffer.Span[0] = Vector3.Distance(a, b);
-            return new(1);
-        }
-
-        public ValueTask<int> Dot(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            buffer.Span[0] = Vector3.Dot(a, b);
-            return new(1);
-        }
-
-        public ValueTask<int> Lerp(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            var t = context.GetArgument<float>(2);
-            buffer.Span[0] = new LuaVector3(Vector3.Lerp(a, b, t));
-            return new(1);
-        }
-
-        public ValueTask<int> LerpUnclamped(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            var t = context.GetArgument<float>(2);
-            buffer.Span[0] = new LuaVector3(Vector3.LerpUnclamped(a, b, t));
-            return new(1);
-        }
-
-        public ValueTask<int> Max(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            buffer.Span[0] = new LuaVector3(Vector3.Max(a, b));
-            return new(1);
-        }
-
-        public ValueTask<int> Min(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            buffer.Span[0] = new LuaVector3(Vector3.Min(a, b));
-            return new(1);
-        }
-
-        public ValueTask<int> MoveTowards(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            var t = context.GetArgument<float>(2);
-            buffer.Span[0] = new LuaVector3(Vector3.MoveTowards(a, b, t));
-            return new(1);
-        }
-
-        public ValueTask<int> Project(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var vector = context.GetArgument<LuaVector3>(0);
-            var onNormal = context.GetArgument<LuaVector3>(1);
-            buffer.Span[0] = new LuaVector3(Vector3.Project(vector, onNormal));
-            return new(1);
-        }
-
-        public ValueTask<int> ProjectOnPlane(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var vector = context.GetArgument<LuaVector3>(0);
-            var planeNormal = context.GetArgument<LuaVector3>(1);
-            buffer.Span[0] = new LuaVector3(Vector3.ProjectOnPlane(vector, planeNormal));
-            return new(1);
-        }
-
-        public ValueTask<int> Reflect(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var inDirection = context.GetArgument<LuaVector3>(0);
-            var inNormal = context.GetArgument<LuaVector3>(1);
-            buffer.Span[0] = new LuaVector3(Vector3.Reflect(inDirection, inNormal));
-            return new(1);
-        }
-
-        public ValueTask<int> RotateTowards(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var current = context.GetArgument<LuaVector3>(0);
-            var target = context.GetArgument<LuaVector3>(1);
-            var maxRadiansDelta = context.GetArgument<float>(2);
-            var maxMagnitudeDelta = context.GetArgument<float>(3);
-            buffer.Span[0] = new LuaVector3(Vector3.RotateTowards(current, target, maxRadiansDelta, maxMagnitudeDelta));
-            return new(1);
-        }
-
-        public ValueTask<int> Scale(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            buffer.Span[0] = new LuaVector3(Vector3.Scale(a, b));
-            return new(1);
-        }
-
-        public ValueTask<int> SignedAngle(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var from = context.GetArgument<LuaVector3>(0);
-            var to = context.GetArgument<LuaVector3>(1);
-            var axis = context.GetArgument<LuaVector3>(2);
-            buffer.Span[0] = Vector3.SignedAngle(from, to, axis);
-            return new(1);
-        }
-
-        public ValueTask<int> Slerp(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            var t = context.GetArgument<float>(2);
-            buffer.Span[0] = new LuaVector3(Vector3.Slerp(a, b, t));
-            return new(1);
-        }
-
-        public ValueTask<int> SlerpUnclamped(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
-        {
-            var a = context.GetArgument<LuaVector3>(0);
-            var b = context.GetArgument<LuaVector3>(1);
-            var t = context.GetArgument<float>(2);
-            buffer.Span[0] = new LuaVector3(Vector3.SlerpUnclamped(a, b, t));
-            return new(1);
-        }
-    }
-
-    [LuaObject]
-    public sealed partial class LuaVector3
-    {
-        Vector3 value;
-
-        [LuaMember("x")]
-        public float X
-        {
-            get => value.x;
-            set => this.value.x = value;
-        }
-
-        [LuaMember("y")]
-        public float Y
-        {
-            get => value.y;
-            set => this.value.y = value;
-        }
-
-        [LuaMember("z")]
-        public float Z
-        {
-            get => value.z;
-            set => this.value.z = value;
-        }
-
-        public LuaVector3(float x, float y, float z)
-        {
-            value = new Vector3(x, y, z);
-        }
-
-        public LuaVector3(Vector3 vector3)
-        {
-            value = vector3;
-        }
-
-        [LuaMember("normalized")]
-        public LuaVector3 Normalized() => new(value.normalized);
-
-        [LuaMember("magnitude")]
-        public float Magnitude() => value.magnitude;
-
-        [LuaMember("sqrmagnitude")]
-        public float SqrMagnitude() => value.sqrMagnitude;
-
-        [LuaMetamethod(LuaObjectMetamethod.Add)]
-        public static LuaVector3 Add(LuaVector3 a, LuaVector3 b)
-        {
-            return new(a.X + b.X, a.Y + b.Y, a.Z + b.Z);
-        }
-
-        [LuaMetamethod(LuaObjectMetamethod.Sub)]
-        public static LuaVector3 Sub(LuaVector3 a, LuaVector3 b)
-        {
-            return new(a.X - b.X, a.Y - b.Y, a.Z - b.Z);
-        }
-
-        [LuaMetamethod(LuaObjectMetamethod.Mul)]
-        public static LuaVector3 Mul(LuaVector3 a, float b)
-        {
-            return new(a.X * b, a.Y * b, a.Z * b);
-        }
-
-        [LuaMetamethod(LuaObjectMetamethod.Div)]
-        public static LuaVector3 Div(LuaVector3 a, float b)
-        {
-            return new(a.X / b, a.Y / b, a.Z / b);
-        }
-
-        [LuaMetamethod(LuaObjectMetamethod.ToString)]
-        public override string ToString()
-        {
-            return value.ToString();
-        }
-
-        public static implicit operator Vector3(LuaVector3 luaVector3)
-        {
-            return new Vector3(luaVector3.X, luaVector3.Y, luaVector3.Z);
-        }
-
-        public static implicit operator LuaVector3(Vector3 luaVector3)
-        {
-            return new LuaVector3(luaVector3.x, luaVector3.y, luaVector3.z);
-        }
-    }
-}