天天看點

Unity Vector3

Unity Vector3 

public struct Vector3
        {
            public float x;
            public float y;
            public float z;
            public float Distance()
            {
                float distance = (float)Math.Sqrt(x * x + y * y + z * z);
                return distance;
            }
            public Vector3(float _x, float _y, float _z)
            {
                this.x = _x;
                this.y = _y;
                this.z = _z;
            }
            public Vector3(float one)
            {
                x = one;
                y = one;
                z = one;
            }
         }