XVector3.cs 1020 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using UnityEngine;
  2. namespace PublicTools.Unity
  3. {
  4. public struct XVector3
  5. {
  6. //
  7. // 摘要:
  8. // X component of the vector.
  9. public float x;
  10. //
  11. // 摘要:
  12. // Y component of the vector.
  13. public float y;
  14. //
  15. // 摘要:
  16. // Z component of the vector.
  17. public float z;
  18. public XVector3(float x, float y, float z)
  19. {
  20. this.x = x;
  21. this.y = y;
  22. this.z = z;
  23. }
  24. public XVector3(Vector3 vector3)
  25. {
  26. this.x = vector3.x;
  27. this.y = vector3.y;
  28. this.z = vector3.z;
  29. }
  30. public Vector3 Trans()
  31. {
  32. Vector3 vector = Vector3.zero;
  33. vector.x = this.x;
  34. vector.y = this.y;
  35. vector.z = this.z;
  36. return vector;
  37. }
  38. //public override string ToString()
  39. //{
  40. // return JsonConvert.SerializeObject(this);
  41. //}
  42. }
  43. }