示例#1
0
    public void createHair2()
    {
        Destroy(part_hair);
        if (!isDeadBody)
        {
            ClothFactory.DisposeObject(part_hair_1);
        }

        if (myCostume.hair_mesh != string.Empty)
        {
            part_hair = (GameObject)Instantiate(Resources.Load("Character/" + myCostume.hair_mesh));
            part_hair.transform.position      = part_head.transform.position;
            part_hair.transform.rotation      = part_head.transform.rotation;
            part_hair.transform.parent        = transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head").transform;
            part_hair.renderer.material       = CharacterMaterials.materials[myCostume.hairInfo.texture];
            part_hair.renderer.material.color = myCostume.hair_color;
        }

        if (myCostume.hair_1_mesh.Length > 0 && !isDeadBody)
        {
            var name     = "Character/" + myCostume.hair_1_mesh;
            var material = CharacterMaterials.materials[myCostume.hairInfo.texture];
            part_hair_1 = ClothFactory.GetHair(reference, name, material, myCostume.hair_color);
        }
    }
示例#2
0
 public void createHair2()
 {
     UnityEngine.Object.Destroy(this.part_hair);
     if (!this.isDeadBody)
     {
         ClothFactory.DisposeObject(this.part_hair_1);
     }
     if (this.myCostume.hair_mesh != string.Empty)
     {
         this.part_hair = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Character/" + this.myCostume.hair_mesh));
         this.part_hair.transform.position      = this.part_head.transform.position;
         this.part_hair.transform.rotation      = this.part_head.transform.rotation;
         this.part_hair.transform.parent        = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head").transform;
         this.part_hair.renderer.material       = CharacterMaterials.materials[this.myCostume.hairInfo.texture];
         this.part_hair.renderer.material.color = this.myCostume.hair_color;
     }
     if ((this.myCostume.hair_1_mesh.Length > 0) && !this.isDeadBody)
     {
         string   name     = "Character/" + this.myCostume.hair_1_mesh;
         Material material = CharacterMaterials.materials[this.myCostume.hairInfo.texture];
         this.part_hair_1 = ClothFactory.GetHair(this.reference, name, material, this.myCostume.hair_color);
     }
 }