Пример #1
0
        public static bool Parse(string text, out Vector4Int32 vector)
        {
            vector = new Vector4Int32();
            if (string.IsNullOrWhiteSpace(text))
            {
                return(false);
            }

            var split = text.Split(',', 'x');

            if (split.Length != 4)
            {
                return(false);
            }
            int x, y, z, w;

            if (int.TryParse(split[0], out x) ||
                int.TryParse(split[1], out y) ||
                int.TryParse(split[2], out z) ||
                int.TryParse(split[3], out w))
            {
                return(false);
            }

            vector = new Vector4Int32(x, y, z, w);
            return(true);
        }
Пример #2
0
 public bool Equals(Vector4Int32 other)
 {
     return(other.W == W && other.X == X && other.Y == Y && other.Z == Z);
 }