LVec3.cs 927 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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
  11. {
  12. return value.X;
  13. }
  14. set
  15. {
  16. this.value = this.value with { X = value };
  17. }
  18. }
  19. [LuaMember("y")]
  20. public float Y
  21. {
  22. get
  23. {
  24. return value.Y;
  25. }
  26. set
  27. {
  28. this.value = this.value with { Y = value };
  29. }
  30. }
  31. [LuaMember("z")]
  32. public float Z
  33. {
  34. get
  35. {
  36. return value.Z;
  37. }
  38. set
  39. {
  40. this.value = this.value with { Z = value };
  41. }
  42. }
  43. [LuaMember("create")]
  44. public static LVec3 Create(float x, float y, float z)
  45. {
  46. return new() { value = new(x, y, z) };
  47. }
  48. public override string ToString()
  49. {
  50. return value.ToString();
  51. }
  52. }