Example #1
0
    public IEnumerator loadskinE(string url)
    {
        while (!this.hasspawn)
        {
            yield return(null);
        }
        bool mipmap            = true;
        bool iteratorVariable1 = false;

        if (((int)FengGameManagerMKII.settings[0x3f]) == 1)
        {
            mipmap = false;
        }
        foreach (Renderer iteratorVariable2 in this.GetComponentsInChildren <Renderer>())
        {
            if (iteratorVariable2.name.Contains("hair"))
            {
                if (!FengGameManagerMKII.linkHash[2].ContainsKey(url))
                {
                    WWW link = new WWW(url);
                    yield return(link);

                    Texture2D iteratorVariable4 = RCextensions.loadimage(link, mipmap, 0xf4240);
                    link.Dispose();
                    if (!FengGameManagerMKII.linkHash[2].ContainsKey(url))
                    {
                        iteratorVariable1 = true;
                        iteratorVariable2.material.mainTexture = iteratorVariable4;
                        FengGameManagerMKII.linkHash[2].Add(url, iteratorVariable2.material);
                        iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                    }
                    else
                    {
                        iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                    }
                }
                else
                {
                    iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                }
            }
        }
        if (iteratorVariable1)
        {
            FengGameManagerMKII.instance.unloadAssets();
        }
    }
Example #2
0
    public IEnumerator loadskinE(string url)
    {
        while (!hasspawn)
        {
            yield return(null);
        }

        var mipmap            = Settings.MipMappingSetting;
        var iteratorVariable1 = false;

        foreach (var iteratorVariable2 in GetComponentsInChildren <Renderer>())
        {
            if (iteratorVariable2.name.Contains("hair"))
            {
                if (!FengGameManagerMKII.linkHash[2].ContainsKey(url))
                {
                    var link = new WWW(url);
                    yield return(link);

                    var iteratorVariable4 = RCextensions.loadimage(link, mipmap, 1000000);
                    link.Dispose();
                    if (!FengGameManagerMKII.linkHash[2].ContainsKey(url))
                    {
                        iteratorVariable1 = true;
                        iteratorVariable2.material.mainTexture = iteratorVariable4;
                        FengGameManagerMKII.linkHash[2].Add(url, iteratorVariable2.material);
                        iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                    }
                    else
                    {
                        iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                    }
                }
                else
                {
                    iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                }
            }
        }

        if (iteratorVariable1)
        {
            FengGameManagerMKII.FGM.unloadAssets();
        }
    }
Example #3
0
    public IEnumerator loadskinE(int hair, int eye, string hairlink)
    {
        bool iteratorVariable0 = false;

        UnityEngine.Object.Destroy(this.part_hair);
        this.hair     = CostumeHair.hairsM[hair];
        this.hairType = hair;
        if (this.hair.hair != string.Empty)
        {
            GameObject iteratorVariable1 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Character/" + this.hair.hair));
            iteratorVariable1.transform.parent     = this.hair_go_ref.transform.parent;
            iteratorVariable1.transform.position   = this.hair_go_ref.transform.position;
            iteratorVariable1.transform.rotation   = this.hair_go_ref.transform.rotation;
            iteratorVariable1.transform.localScale = this.hair_go_ref.transform.localScale;
            iteratorVariable1.renderer.material    = CharacterMaterials.materials[this.hair.texture];
            bool mipmap = true;
            if (((int)FengGameManagerMKII.settings[0x3f]) == 1)
            {
                mipmap = false;
            }
            if ((!hairlink.EndsWith(".jpg") && !hairlink.EndsWith(".png")) && !hairlink.EndsWith(".jpeg"))
            {
                if (hairlink.ToLower() == "transparent")
                {
                    iteratorVariable1.renderer.enabled = false;
                }
            }
            else if (!FengGameManagerMKII.linkHash[0].ContainsKey(hairlink))
            {
                WWW link = new WWW(hairlink);
                yield return(link);

                Texture2D iteratorVariable4 = RCextensions.loadimage(link, mipmap, 0x30d40);
                link.Dispose();
                if (FengGameManagerMKII.linkHash[0].ContainsKey(hairlink))
                {
                    iteratorVariable1.renderer.material = (Material)FengGameManagerMKII.linkHash[0][hairlink];
                }
                else
                {
                    iteratorVariable0 = true;
                    iteratorVariable1.renderer.material.mainTexture = iteratorVariable4;
                    FengGameManagerMKII.linkHash[0].Add(hairlink, iteratorVariable1.renderer.material);
                    iteratorVariable1.renderer.material = (Material)FengGameManagerMKII.linkHash[0][hairlink];
                }
            }
            else
            {
                iteratorVariable1.renderer.material = (Material)FengGameManagerMKII.linkHash[0][hairlink];
            }
            this.part_hair = iteratorVariable1;
        }
        if (eye >= 0)
        {
            this.setFacialTexture(this.eye, eye);
        }
        if (iteratorVariable0)
        {
            FengGameManagerMKII.instance.unloadAssets();
        }
    }
Example #4
0
    public IEnumerator loadskinE(int hair, int eye, string hairlink)
    {
        var iteratorVariable0 = false;

        Destroy(part_hair);
        this.hair = CostumeHair.hairsM[hair];
        hairType  = hair;
        if (this.hair.hair != string.Empty)
        {
            var iteratorVariable1 = (GameObject)Instantiate(Resources.Load("Character/" + this.hair.hair));
            iteratorVariable1.transform.parent     = hair_go_ref.transform.parent;
            iteratorVariable1.transform.position   = hair_go_ref.transform.position;
            iteratorVariable1.transform.rotation   = hair_go_ref.transform.rotation;
            iteratorVariable1.transform.localScale = hair_go_ref.transform.localScale;
            iteratorVariable1.renderer.material    = CharacterMaterials.materials[this.hair.texture];
            var mipmap = Settings.MipMappingSetting;

            if (!hairlink.EndsWith(".jpg") && !hairlink.EndsWith(".png") && !hairlink.EndsWith(".jpeg"))
            {
                if (hairlink.ToLower() == "transparent")
                {
                    iteratorVariable1.renderer.enabled = false;
                }
            }
            else if (FengGameManagerMKII.linkHash[0].ContainsKey(hairlink))
            {
                iteratorVariable1.renderer.material = (Material)FengGameManagerMKII.linkHash[0][hairlink];
            }
            else
            {
                var link = new WWW(hairlink);
                yield return(link);

                var iteratorVariable4 = RCextensions.loadimage(link, mipmap, 200000);
                link.Dispose();
                if (!FengGameManagerMKII.linkHash[0].ContainsKey(hairlink))
                {
                    iteratorVariable0 = true;
                    iteratorVariable1.renderer.material.mainTexture = iteratorVariable4;
                    FengGameManagerMKII.linkHash[0].Add(hairlink, iteratorVariable1.renderer.material);
                    iteratorVariable1.renderer.material = (Material)FengGameManagerMKII.linkHash[0][hairlink];
                }
                else
                {
                    iteratorVariable1.renderer.material = (Material)FengGameManagerMKII.linkHash[0][hairlink];
                }
            }

            part_hair = iteratorVariable1;
        }

        if (eye >= 0)
        {
            setFacialTexture(this.eye, eye);
        }

        if (iteratorVariable0)
        {
            FengGameManagerMKII.FGM.unloadAssets();
        }
    }