using System; using UnityEngine; namespace PublicTools.Unity { public struct XVector3 { // // 摘要: // X component of the vector. public float x; // // 摘要: // Y component of the vector. public float y; // // 摘要: // Z component of the vector. public float z; public XVector3(float x, float y, float z) { this.x = x; this.y = y; this.z = z; } public XVector3(Vector3 vector3) { this.x = vector3.x; this.y = vector3.y; this.z = vector3.z; } public XVector3(Vector3 vector3, int count) { this.x = (float)Math.Round(vector3.x, count); this.y = (float)Math.Round(vector3.y, count); this.z = (float)Math.Round(vector3.z, count); } public Vector3 Trans() { Vector3 vector = Vector3.zero; vector.x = this.x; vector.y = this.y; vector.z = this.z; return vector; } //public override string ToString() //{ // return JsonConvert.SerializeObject(this); //} } }