Esempio n. 1
0
    private void ChangeMesh(string part, string item)
    {
        this.SetCurrentMesh(part, item);
        SkinnedMeshRenderer component = this.data.get_Item(part).get_Item(item).GetComponent <SkinnedMeshRenderer>();
        List <Transform>    list      = new List <Transform>();

        Transform[] bones = component.get_bones();
        for (int i = 0; i < bones.Length; i++)
        {
            Transform   transform = bones[i];
            Transform[] array     = this.targetHips;
            for (int j = 0; j < array.Length; j++)
            {
                Transform transform2 = array[j];
                if (!(transform2.get_name() != transform.get_name()))
                {
                    list.Add(transform2);
                    break;
                }
            }
        }
        this.targetSmr.get_Item(part).set_sharedMesh(component.get_sharedMesh());
        this.targetSmr.get_Item(part).set_bones(list.ToArray());
        Material[] materials = new Material[]
        {
            component.get_materials()[0]
        };
        this.targetSmr.get_Item(part).set_materials(materials);
    }
Esempio n. 2
0
    private void ChangeMaterial(string part, string item)
    {
        this.SetCurrentMaterial(part, item);
        int currentMeshType           = this.GetCurrentMeshType(part);
        SkinnedMeshRenderer component = this.data.get_Item(part).get_Item(currentMeshType.ToString()).GetComponent <SkinnedMeshRenderer>();
        int num = int.Parse(item) - 1;

        Material[] materials = new Material[]
        {
            component.get_materials()[num]
        };
        this.targetSmr.get_Item(part).set_materials(materials);
    }