Esempio n. 1
0
        // Token: 0x06000221 RID: 545 RVA: 0x00011804 File Offset: 0x0000FA04
        public void NormalizeBodyAnchorList()
        {
            bool flag = this.BodyAnchorList.Count > 0;

            if (flag)
            {
                List <int> list = new List <int>(this.BodyAnchorList.Count);
                Dictionary <string, int> dictionary = new Dictionary <string, int>(this.BodyAnchorList.Count);
                for (int i = 0; i < this.BodyAnchorList.Count; i++)
                {
                    PmxSoftBody.BodyAnchor bodyAnchor = this.BodyAnchorList[i];
                    string key   = bodyAnchor.Body.ToString() + "_" + bodyAnchor.Vertex.ToString();
                    bool   flag2 = !dictionary.ContainsKey(key);
                    if (flag2)
                    {
                        dictionary.Add(key, i);
                    }
                    else
                    {
                        list.Add(i);
                    }
                }
                bool flag3 = list.Count > 0;
                if (flag3)
                {
                    int[] array = CP.SortIndexForRemove(list.ToArray());
                    for (int j = 0; j < array.Length; j++)
                    {
                        this.BodyAnchorList.RemoveAt(array[j]);
                    }
                }
            }
        }
Esempio n. 2
0
        public void NormalizeBodyAnchorList()
        {
            if (BodyAnchorList.Count <= 0)
            {
                return;
            }
            List <int> list = new List <int>(BodyAnchorList.Count);
            Dictionary <string, int> dictionary = new Dictionary <string, int>(BodyAnchorList.Count);

            for (int i = 0; i < BodyAnchorList.Count; i++)
            {
                BodyAnchor bodyAnchor = BodyAnchorList[i];
                string     key        = bodyAnchor.Body + "_" + bodyAnchor.Vertex;
                if (!dictionary.ContainsKey(key))
                {
                    dictionary.Add(key, i);
                }
                else
                {
                    list.Add(i);
                }
            }
            if (list.Count > 0)
            {
                int[] array = CP.SortIndexForRemove(list.ToArray());
                for (int j = 0; j < array.Length; j++)
                {
                    BodyAnchorList.RemoveAt(array[j]);
                }
            }
        }