Esempio n. 1
0
    private void Start()
    {
        SkinnedMeshRenderer[] componentsInChildren = this.source.GetComponentsInChildren <SkinnedMeshRenderer>(true);
        SkinnedMeshRenderer[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            SkinnedMeshRenderer skinnedMeshRenderer = array[i];
            string[]            array2 = skinnedMeshRenderer.get_name().Split(new char[]
            {
                '-'
            });
            if (!this.targetSmr.ContainsKey(array2[0]))
            {
                this.data.Add(array2[0], new Dictionary <string, Transform>());
                GameObject gameObject = new GameObject();
                gameObject.set_name(array2[0]);
                gameObject.get_transform().set_parent(this.target);
                SkinnedMeshRenderer skinnedMeshRenderer2 = gameObject.AddComponent <SkinnedMeshRenderer>();
                this.targetSmr.Add(array2[0], skinnedMeshRenderer2);
            }
            this.data.get_Item(array2[0]).Add(array2[1], skinnedMeshRenderer.get_transform());
        }
        this.targetHips = this.target.GetComponentsInChildren <Transform>();
        using (Dictionary <string, Dictionary <string, Transform> > .Enumerator enumerator = this.data.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                KeyValuePair <string, Dictionary <string, Transform> > current = enumerator.get_Current();
                string key = current.get_Key();
                if (key != null)
                {
                    if (TestChar.< > f__switch$map12 == null)
                    {
                        Dictionary <string, int> dictionary = new Dictionary <string, int>(6);
                        dictionary.Add("eyes", 0);
                        dictionary.Add("face", 1);
                        dictionary.Add("hair", 2);
                        dictionary.Add("pants", 3);
                        dictionary.Add("shoes", 4);
                        dictionary.Add("top", 5);
                        TestChar.< > f__switch$map12 = dictionary;
                    }
                    int num;
                    if (TestChar.< > f__switch$map12.TryGetValue(key, ref num))
                    {
                        switch (num)
                        {
                        case 0:
                            this.InitCharactor("eyes", "1");
                            break;

                        case 1:
                            this.InitCharactor("face", "1");
                            break;

                        case 2:
                            this.InitCharactor("hair", "1");
                            break;

                        case 3:
                            this.InitCharactor("pants", "1");
                            break;

                        case 4:
                            this.InitCharactor("shoes", "1");
                            break;

                        case 5:
                            this.InitCharactor("top", "1");
                            break;
                        }
                    }
                }
            }
        }
    }