Exemple #1
0
        public static int GetElementsHash <T>(this IEnumerable <T> list)
        {
            int hash = 0;

            foreach (var item in list)
            {
                HashUtilities.AdditiveHash(ref hash, item.GetHashCode());
            }
            return(hash);
        }
        public static int GetHashOfTransform(Transform transform, bool includeChildren = true)
        {
            int hash = transform.gameObject.name.GetHashCode();

            if (includeChildren)
            {
                for (int i = 0; i < transform.childCount; i++)
                {
                    //hash = GetHashOfTransform(transform, true);
                    HashUtilities.AdditiveHash(ref hash, GetHashOfTransform(transform.GetChild(i), true));
                }
            }

            return(hash);
        }