Example #1
0
    public void deleteCharacterComponent2()
    {
        Destroy(part_eye);
        Destroy(part_face);
        Destroy(part_glass);
        Destroy(part_hair);
        if (!isDeadBody)
        {
            ClothFactory.DisposeObject(part_hair_1);
        }

        Destroy(part_upper_body);
        Destroy(part_arm_l);
        Destroy(part_arm_r);
        if (!isDeadBody)
        {
            ClothFactory.DisposeObject(part_hair_2);
            ClothFactory.DisposeObject(part_cape);
        }

        Destroy(part_brand_1);
        Destroy(part_brand_2);
        Destroy(part_brand_3);
        Destroy(part_brand_4);
        Destroy(part_chest_1);
        Destroy(part_chest_2);
        Destroy(part_chest_3);
        Destroy(part_3dmg);
        Destroy(part_3dmg_belt);
        Destroy(part_3dmg_gas_l);
        Destroy(part_3dmg_gas_r);
        Destroy(part_blade_l);
        Destroy(part_blade_r);
    }
Example #2
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);
        }
    }
Example #3
0
 public void CreateHead()
 {
     Object.Destroy(part_eye);
     Object.Destroy(part_face);
     Object.Destroy(part_glass);
     Object.Destroy(part_hair);
     if (!isDeadBody)
     {
         ClothFactory.DisposeObject(part_hair_1);
     }
     CreateHair();
     if (myCostume.eye_mesh.Length > 0)
     {
         part_eye = (GameObject)Object.Instantiate(Resources.Load("Character/" + myCostume.eye_mesh));
         part_eye.transform.position = part_head.transform.position;
         part_eye.transform.rotation = part_head.transform.rotation;
         part_eye.transform.parent   = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head").transform;
         SetFaceTexture(part_eye, myCostume.eye_texture_id);
     }
     if (myCostume.beard_texture_id >= 0)
     {
         CreateFace();
         SetFaceTexture(part_face, myCostume.beard_texture_id);
     }
     if (myCostume.glass_texture_id >= 0)
     {
         CreateGlasses();
         SetFaceTexture(part_glass, myCostume.glass_texture_id);
     }
     part_head.renderer.material  = CharacterMaterials.materials[myCostume.skin_texture];
     part_chest.renderer.material = CharacterMaterials.materials[myCostume.skin_texture];
 }
Example #4
0
 public void createHead2()
 {
     UnityEngine.Object.Destroy(this.part_eye);
     UnityEngine.Object.Destroy(this.part_face);
     UnityEngine.Object.Destroy(this.part_glass);
     UnityEngine.Object.Destroy(this.part_hair);
     if (!this.isDeadBody)
     {
         ClothFactory.DisposeObject(this.part_hair_1);
     }
     this.createHair2();
     if (this.myCostume.eye_mesh.Length > 0)
     {
         this.part_eye = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Character/" + this.myCostume.eye_mesh));
         this.part_eye.transform.position = this.part_head.transform.position;
         this.part_eye.transform.rotation = this.part_head.transform.rotation;
         this.part_eye.transform.parent   = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head").transform;
         this.setFacialTexture(this.part_eye, this.myCostume.eye_texture_id);
     }
     if (this.myCostume.beard_texture_id >= 0)
     {
         this.createFace();
         this.setFacialTexture(this.part_face, this.myCostume.beard_texture_id);
     }
     if (this.myCostume.glass_texture_id >= 0)
     {
         this.createGlass();
         this.setFacialTexture(this.part_glass, this.myCostume.glass_texture_id);
     }
     this.part_head.renderer.material  = CharacterMaterials.materials[this.myCostume.skin_texture];
     this.part_chest.renderer.material = CharacterMaterials.materials[this.myCostume.skin_texture];
 }
Example #5
0
 public void createCape2()
 {
     if (!isDeadBody)
     {
         ClothFactory.DisposeObject(part_cape);
         if (myCostume.cape_mesh.Length > 0)
         {
             part_cape = ClothFactory.GetCape(reference, "Character/" + myCostume.cape_mesh, CharacterMaterials.materials[myCostume.brand_texture]);
         }
     }
 }
Example #6
0
 public void CreateCape()
 {
     if (!this.IsDeadBody)
     {
         ClothFactory.DisposeObject(this.part_cape);
         if (this.myCostume.cape_mesh.Length > 0)
         {
             this.part_cape = ClothFactory.GetCape(this.reference, "Character/" + this.myCostume.cape_mesh, CharacterMaterials.Materials[this.myCostume.brand_texture]);
         }
     }
 }
Example #7
0
    public void DestroyAllExistingCloths()
    {
        var array = FindObjectsOfType <Cloth>();
        var flag  = array.Length != 0;

        if (flag)
        {
            for (var i = 0; i < array.Length; i++)
            {
                ClothFactory.DisposeObject(array[i].gameObject);
            }
        }
    }
Example #8
0
    public void CreateHead()
    {
        UnityEngine.Object.Destroy(this.part_eye);
        UnityEngine.Object.Destroy(this.part_face);
        UnityEngine.Object.Destroy(this.part_glass);
        UnityEngine.Object.Destroy(this.part_hair);
        if (!this.IsDeadBody)
        {
            ClothFactory.DisposeObject(this.part_hair_1);
        }
        this.CreateHair();
        if (this.myCostume.eye_mesh.Length > 0)
        {
            this.part_eye = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.eye_mesh));
            this.part_eye.transform.position = this.part_head.transform.position;
            this.part_eye.transform.rotation = this.part_head.transform.rotation;
            this.part_eye.transform.parent   = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head").transform;
            this.SetFacialTexture(this.part_eye, this.myCostume.eye_texture_id);
        }
        if (this.myCostume.beard_texture_id >= 0)
        {
            this.CreateFace();
            this.SetFacialTexture(this.part_face, this.myCostume.beard_texture_id);
        }
        if (this.myCostume.glass_texture_id >= 0)
        {
            this.CreateGlass();
            this.SetFacialTexture(this.part_glass, this.myCostume.glass_texture_id);
        }
        string indexHead  = myCostume.skin_texture;
        string indexChest = myCostume.skin_texture;

        if (!CharacterMaterials.Materials.ContainsKey(indexHead))
        {
            indexHead = "hair_annie";
        }
        if (!CharacterMaterials.Materials.ContainsKey(indexChest))
        {
            indexChest = "aottg_hero_skin_1";
        }
        this.part_head.renderer.material  = CharacterMaterials.Materials[indexHead];
        this.part_chest.renderer.material = CharacterMaterials.Materials[indexChest];
    }
Example #9
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);
     }
 }
Example #10
0
    public void DeleteCharacterComponent()
    {
        UnityEngine.Object.Destroy(this.part_eye);
        UnityEngine.Object.Destroy(this.part_face);
        UnityEngine.Object.Destroy(this.part_glass);
        UnityEngine.Object.Destroy(this.part_hair);
        bool flag = !this.IsDeadBody;

        if (flag)
        {
            ClothFactory.DisposeObject(this.part_hair_1);
        }
        UnityEngine.Object.Destroy(this.part_upper_body);
        UnityEngine.Object.Destroy(this.part_arm_l);
        UnityEngine.Object.Destroy(this.part_arm_r);
        bool flag2 = !this.IsDeadBody;

        if (flag2)
        {
            ClothFactory.DisposeObject(this.part_hair_2);
            ClothFactory.DisposeObject(this.part_cape);
        }
        UnityEngine.Object.Destroy(this.part_brand_1);
        UnityEngine.Object.Destroy(this.part_brand_2);
        UnityEngine.Object.Destroy(this.part_brand_3);
        UnityEngine.Object.Destroy(this.part_brand_4);
        UnityEngine.Object.Destroy(this.part_chest_1);
        UnityEngine.Object.Destroy(this.part_chest_2);
        UnityEngine.Object.Destroy(this.part_chest_3);
        UnityEngine.Object.Destroy(this.part_3dmg);
        UnityEngine.Object.Destroy(this.part_3dmg_belt);
        UnityEngine.Object.Destroy(this.part_3dmg_gas_l);
        UnityEngine.Object.Destroy(this.part_3dmg_gas_r);
        UnityEngine.Object.Destroy(this.part_blade_l);
        UnityEngine.Object.Destroy(this.part_blade_r);
    }
Example #11
0
    public void createUpperBody2()
    {
        Destroy(part_upper_body);
        Destroy(part_brand_1);
        Destroy(part_brand_2);
        Destroy(part_brand_3);
        Destroy(part_brand_4);
        Destroy(part_chest_1);
        Destroy(part_chest_2);
        if (!isDeadBody)
        {
            ClothFactory.DisposeObject(part_chest_3);
        }

        createCape2();
        if (myCostume.part_chest_object_mesh.Length > 0)
        {
            part_chest_1 = (GameObject)Instantiate(Resources.Load("Character/" + myCostume.part_chest_object_mesh));
            part_chest_1.transform.position = chest_info.transform.position;
            part_chest_1.transform.rotation = chest_info.transform.rotation;
            part_chest_1.transform.parent   = transform.Find("Amarture/Controller_Body/hip/spine/chest").transform;
            part_chest_1.renderer.material  = CharacterMaterials.materials[myCostume.part_chest_object_texture];
        }

        if (myCostume.part_chest_1_object_mesh.Length > 0)
        {
            part_chest_2 = (GameObject)Instantiate(Resources.Load("Character/" + myCostume.part_chest_1_object_mesh));
            part_chest_2.transform.position = chest_info.transform.position;
            part_chest_2.transform.rotation = chest_info.transform.rotation;
            part_chest_2.transform.parent   = transform.Find("Amarture/Controller_Body/hip/spine/chest").transform;
            part_chest_2.transform.parent   = transform.Find("Amarture/Controller_Body/hip/spine/chest").transform;
            part_chest_2.renderer.material  = CharacterMaterials.materials[myCostume.part_chest_1_object_texture];
        }

        if (myCostume.part_chest_skinned_cloth_mesh.Length > 0 && !isDeadBody)
        {
            part_chest_3 = ClothFactory.GetCape(reference, "Character/" + myCostume.part_chest_skinned_cloth_mesh, CharacterMaterials.materials[myCostume.part_chest_skinned_cloth_texture]);
        }

        if (myCostume.body_mesh.Length > 0)
        {
            part_upper_body = GenerateCloth(reference, "Character/" + myCostume.body_mesh);
            part_upper_body.renderer.material = CharacterMaterials.materials[myCostume.body_texture];
        }

        if (myCostume.brand1_mesh.Length > 0)
        {
            part_brand_1 = GenerateCloth(reference, "Character/" + myCostume.brand1_mesh);
            part_brand_1.renderer.material = CharacterMaterials.materials[myCostume.brand_texture];
        }

        if (myCostume.brand2_mesh.Length > 0)
        {
            part_brand_2 = GenerateCloth(reference, "Character/" + myCostume.brand2_mesh);
            part_brand_2.renderer.material = CharacterMaterials.materials[myCostume.brand_texture];
        }

        if (myCostume.brand3_mesh.Length > 0)
        {
            part_brand_3 = GenerateCloth(reference, "Character/" + myCostume.brand3_mesh);
            part_brand_3.renderer.material = CharacterMaterials.materials[myCostume.brand_texture];
        }

        if (myCostume.brand4_mesh.Length > 0)
        {
            part_brand_4 = GenerateCloth(reference, "Character/" + myCostume.brand4_mesh);
            part_brand_4.renderer.material = CharacterMaterials.materials[myCostume.brand_texture];
        }

        part_head.renderer.material  = CharacterMaterials.materials[myCostume.skin_texture];
        part_chest.renderer.material = CharacterMaterials.materials[myCostume.skin_texture];
    }
Example #12
0
 public void createUpperBody2()
 {
     UnityEngine.Object.Destroy(this.part_upper_body);
     UnityEngine.Object.Destroy(this.part_brand_1);
     UnityEngine.Object.Destroy(this.part_brand_2);
     UnityEngine.Object.Destroy(this.part_brand_3);
     UnityEngine.Object.Destroy(this.part_brand_4);
     UnityEngine.Object.Destroy(this.part_chest_1);
     UnityEngine.Object.Destroy(this.part_chest_2);
     if (!this.isDeadBody)
     {
         ClothFactory.DisposeObject(this.part_chest_3);
     }
     this.createCape2();
     if (this.myCostume.part_chest_object_mesh.Length > 0)
     {
         this.part_chest_1 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Character/" + this.myCostume.part_chest_object_mesh));
         this.part_chest_1.transform.position = this.chest_info.transform.position;
         this.part_chest_1.transform.rotation = this.chest_info.transform.rotation;
         this.part_chest_1.transform.parent   = base.transform.Find("Amarture/Controller_Body/hip/spine/chest").transform;
         this.part_chest_1.renderer.material  = CharacterMaterials.materials[this.myCostume.part_chest_object_texture];
     }
     if (this.myCostume.part_chest_1_object_mesh.Length > 0)
     {
         this.part_chest_2 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Character/" + this.myCostume.part_chest_1_object_mesh));
         this.part_chest_2.transform.position = this.chest_info.transform.position;
         this.part_chest_2.transform.rotation = this.chest_info.transform.rotation;
         this.part_chest_2.transform.parent   = base.transform.Find("Amarture/Controller_Body/hip/spine/chest").transform;
         this.part_chest_2.transform.parent   = base.transform.Find("Amarture/Controller_Body/hip/spine/chest").transform;
         this.part_chest_2.renderer.material  = CharacterMaterials.materials[this.myCostume.part_chest_1_object_texture];
     }
     if ((this.myCostume.part_chest_skinned_cloth_mesh.Length > 0) && !this.isDeadBody)
     {
         this.part_chest_3 = ClothFactory.GetCape(this.reference, "Character/" + this.myCostume.part_chest_skinned_cloth_mesh, CharacterMaterials.materials[this.myCostume.part_chest_skinned_cloth_texture]);
     }
     if (this.myCostume.body_mesh.Length > 0)
     {
         this.part_upper_body = this.GenerateCloth(this.reference, "Character/" + this.myCostume.body_mesh);
         this.part_upper_body.renderer.material = CharacterMaterials.materials[this.myCostume.body_texture];
     }
     if (this.myCostume.brand1_mesh.Length > 0)
     {
         this.part_brand_1 = this.GenerateCloth(this.reference, "Character/" + this.myCostume.brand1_mesh);
         this.part_brand_1.renderer.material = CharacterMaterials.materials[this.myCostume.brand_texture];
     }
     if (this.myCostume.brand2_mesh.Length > 0)
     {
         this.part_brand_2 = this.GenerateCloth(this.reference, "Character/" + this.myCostume.brand2_mesh);
         this.part_brand_2.renderer.material = CharacterMaterials.materials[this.myCostume.brand_texture];
     }
     if (this.myCostume.brand3_mesh.Length > 0)
     {
         this.part_brand_3 = this.GenerateCloth(this.reference, "Character/" + this.myCostume.brand3_mesh);
         this.part_brand_3.renderer.material = CharacterMaterials.materials[this.myCostume.brand_texture];
     }
     if (this.myCostume.brand4_mesh.Length > 0)
     {
         this.part_brand_4 = this.GenerateCloth(this.reference, "Character/" + this.myCostume.brand4_mesh);
         this.part_brand_4.renderer.material = CharacterMaterials.materials[this.myCostume.brand_texture];
     }
     this.part_head.renderer.material  = CharacterMaterials.materials[this.myCostume.skin_texture];
     this.part_chest.renderer.material = CharacterMaterials.materials[this.myCostume.skin_texture];
 }