コード例 #1
0
        public static Vector3[] RemoveDuplicates(this Vector3[] array)
        {
            IEqualityComparer <Vector3> vector3Compare = new Vector3EqualityComparer();
            List <Vector3> result = new List <Vector3>();

            foreach (var a in array)
            {
                if (!result.Contains(a, vector3Compare))
                {
                    result.Add(a);
                }
            }
            return(result.ToArray());
        }
コード例 #2
0
        public static bool CheckForDuplicates(this Vector3[] array)
        {
            IEqualityComparer <Vector3> vector3Compare = new Vector3EqualityComparer();

            return(array.Count() != array.Distinct(vector3Compare).Count());
        }