LVec3.cs 746 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Numerics;
  2. using Lua;
  3. [LuaObject]
  4. public partial class LVec3
  5. {
  6. Vector3 value;
  7. [LuaMember("x")]
  8. public float X
  9. {
  10. get => value.X;
  11. set => this.value = this.value with { X = value };
  12. }
  13. [LuaMember("y")]
  14. public float Y
  15. {
  16. get => value.Y;
  17. set => this.value = this.value with { Y = value };
  18. }
  19. [LuaMember("z")]
  20. public float Z
  21. {
  22. get => value.Z;
  23. set => this.value = this.value with { Z = value };
  24. }
  25. [LuaMember("create")]
  26. public static LVec3 Create(float x, float y, float z)
  27. {
  28. return new LVec3() { value = new Vector3(x, y, z) };
  29. }
  30. public override string ToString()
  31. {
  32. return value.ToString();
  33. }
  34. }