Ejemplo n.º 1
0
        void Awake()
        {
            this.character = GameObject.Find("CharacterModel");
            this.loadingImage = Resources.Load<Texture>("Sprites/SplashImages/LoadingImage");

            this.incr = Random.Range(-0.02f, 0.02f);
            this.incg = Random.Range(-0.02f, 0.02f);
            this.incb = Random.Range(-0.02f, 0.02f);
            this.manager = GetComponent<NetworkManager>();
            this.skin = Resources.Load<GUISkin>("Sprites/GUIskin/skin");
            this.skin.GetStyle("chat").fontSize = (int)(Screen.height * 0.025f);
            this.skin.GetStyle("chat").alignment = TextAnchor.MiddleCenter;
            this.skin.GetStyle("chat").fontStyle = FontStyle.Bold;
            this.skin.textField.fontSize = (int)(Screen.height * 0.025f);
            this.skin.textField.fontStyle = FontStyle.Bold;

            this.skin.GetStyle("button").fontSize = (int)(Screen.height * 0.025f);
            this.posX = (int)(Screen.width / 2.6f);
            this.posY = (int)(Screen.height / 2.5f);
            this.width = Screen.width / 4;
            this.height = Screen.height / 30;
            this.spacing = this.height * 2;
            this.playerName = PlayerPrefs.GetString("PlayerName", "");
            SystemLanguage langue = PlayerPrefs.GetInt("langue", 1) == 1 ? SystemLanguage.English : SystemLanguage.French;
            this.categoryCloth = CategoryCloth.None;
            Text.SetLanguage(langue);
            this.firstScene = GameObject.Find("Map").GetComponent<FirstScene>();

            if (!Directory.Exists(Application.dataPath + "/Saves"))
                Directory.CreateDirectory(Application.dataPath + "/Saves");
            this.skin.GetStyle("loading").normal.textColor = Color.black;

            try
            {
                string skintStr = PlayerPrefs.GetString("Skin", "");
                this.skinCharacter = Skin.Load(skintStr);
                this.skinCharacter.ForceApply(this.character);
            }
            catch
            {
                this.characterShown = true;
                this.skinCharacter = new Skin(Clothing.NormalBrownBeard, Clothing.NormalBrownHair, Clothing.NoneHat, Clothing.BasicBody, Clothing.NoneTshirt, Clothing.BrownOveralls, Clothing.BrownGloves, Clothing.BlackEye);
                this.skinCharacter.ForceApply(this.character);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///  Dessine l'interface des options du personnage.
        /// </summary>
        private void DrawCharacter()
        {
            this.smoothAparition += Time.deltaTime;
            this.skin.textField.alignment = TextAnchor.MiddleCenter;
            this.playerName = GUI.TextField(new Rect(this.posX, this.posY + this.spacing * 6.2f, this.width, this.height), this.RemoveSpecialCharacter(this.playerName, "abcdefghijklmnopqrstuvwxyz123456789-_", false), 15, this.skin.textField);
            bool firstLaunch = PlayerPrefs.GetString("PlayerName", "") == "";

            if (this.playerName != "" && GUI.Button(new Rect(this.posX, this.posY + this.spacing * 7f, this.width / (firstLaunch ? 1f : 2.1f), this.height), TextDatabase.Validate.GetText(), this.skin.GetStyle("button")))
            {
                this.characterShown = false;
                this.firstScene.OnChar = false;
                PlayerPrefs.SetString("PlayerName", this.playerName);
                PlayerPrefs.SetString("Skin", Skin.Save(this.skinCharacter));
                this.firstScene.PlayButtonSound();
            }
            if (!firstLaunch && GUI.Button(new Rect(this.posX + this.width / 1.9f, this.posY + this.spacing * 7, this.width / 2.1f, this.height), TextDatabase.Back.GetText(), this.skin.GetStyle("button")))
            {
                this.characterShown = false;
                this.firstScene.OnChar = false;
                this.optionShown = true;
                this.playerName = PlayerPrefs.GetString("PlayerName", "");
                this.firstScene.PlayButtonSound();
            }

            if (GUI.RepeatButton(new Rect(this.posX + this.width - this.width / 4, this.posY + this.spacing * 4.8f, this.width / 4, this.width / 6), "", this.skin.GetStyle("right_arrow")))
                this.character.transform.Rotate(Vector3.up, -5);
            if (GUI.RepeatButton(new Rect(this.posX, this.posY + this.spacing * 4.8f, this.width / 4, this.width / 6), "", this.skin.GetStyle("left_arrow")))
                this.character.transform.Rotate(Vector3.up, +5);

            #region Category
            if (GUI.Button(new Rect(this.posX, this.posY - this.spacing * 1.5f, this.width / 5, this.width / 5), Resources.Load<Texture2D>("Sprites/Cosmetics/HatIcon"), skin.GetStyle("Square")))
            {
                if (this.categoryCloth == CategoryCloth.Hat)
                    this.categoryCloth = CategoryCloth.None;
                else
                {
                    this.categoryCloth = CategoryCloth.Hat;
                    this.smoothAparition = 0;
                }
            }
            if (GUI.Button(new Rect(this.posX, this.posY, this.width / 5, this.width / 5), Resources.Load<Texture2D>("Sprites/Cosmetics/BeardIcon"), skin.GetStyle("Square")))
            {
                if (this.categoryCloth == CategoryCloth.Beard)
                    this.categoryCloth = CategoryCloth.None;
                else
                {
                    this.smoothAparition = 0;
                    this.categoryCloth = CategoryCloth.Beard;
                }
            }
            if (GUI.Button(new Rect(this.posX, this.posY + this.spacing * 1.5f, this.width / 5, this.width / 5), Resources.Load<Texture2D>("Sprites/Cosmetics/BodyIcon"), skin.GetStyle("Square")))
            {
                if (this.categoryCloth == CategoryCloth.Body)
                    this.categoryCloth = CategoryCloth.None;
                else
                {
                    this.smoothAparition = 0;
                    this.categoryCloth = CategoryCloth.Body;
                }
            }
            if (GUI.Button(new Rect(this.posX + this.width - this.width / 5, this.posY, this.width / 5, this.width / 5), Resources.Load<Texture2D>("Sprites/Cosmetics/EyeIcon"), skin.GetStyle("Square")))
            {
                if (this.categoryCloth == CategoryCloth.Eyes)
                    this.categoryCloth = CategoryCloth.None;
                else
                {
                    this.smoothAparition = 0;
                    this.categoryCloth = CategoryCloth.Eyes;
                }
            }
            if (GUI.Button(new Rect(this.posX + this.width - this.width / 5, this.posY - this.spacing * 1.5f, this.width / 5, this.width / 5), Resources.Load<Texture2D>("Sprites/Cosmetics/HairIcon"), skin.GetStyle("Square")))
            {
                if (this.categoryCloth == CategoryCloth.Hair)
                    this.categoryCloth = CategoryCloth.None;
                else
                {
                    this.smoothAparition = 0;
                    this.categoryCloth = CategoryCloth.Hair;
                }
            }
            if (GUI.Button(new Rect(this.posX, this.posY + this.spacing * 3f, this.width / 5, this.width / 5), Resources.Load<Texture2D>("Sprites/Cosmetics/GlovesIcon"), skin.GetStyle("Square")))
            {
                if (this.categoryCloth == CategoryCloth.Gloves)
                    this.categoryCloth = CategoryCloth.None;
                else
                {
                    this.smoothAparition = 0;
                    this.categoryCloth = CategoryCloth.Gloves;
                }
            }
            if (GUI.Button(new Rect(this.posX + this.width - this.width / 5, this.posY + this.spacing * 1.5f, this.width / 5, this.width / 5), Resources.Load<Texture2D>("Sprites/Cosmetics/TshirtIcon"), skin.GetStyle("Square")))
            {
                if (this.categoryCloth == CategoryCloth.TShirt)
                    this.categoryCloth = CategoryCloth.None;
                else
                {
                    this.smoothAparition = 0;
                    this.categoryCloth = CategoryCloth.TShirt;
                }
            }
            if (GUI.Button(new Rect(this.posX + this.width - this.width / 5, this.posY + this.spacing * 3f, this.width / 5, this.width / 5), Resources.Load<Texture2D>("Sprites/Cosmetics/PantIcon"), skin.GetStyle("Square")))
            {
                if (this.categoryCloth == CategoryCloth.Pant)
                    this.categoryCloth = CategoryCloth.None;
                else
                {
                    this.categoryCloth = CategoryCloth.Pant;
                    this.smoothAparition = 0;
                }
            }
            if (GUI.Button(new Rect(this.posX + this.width + this.width / 5, this.posY - this.spacing * 1.5f, this.width / 5, this.width / 5), Resources.Load<Texture2D>("Sprites/Cosmetics/RandomIcon"), skin.GetStyle("Square")))
            {
                this.categoryCloth = CategoryCloth.None;
                this.skinCharacter = Skin.RandomSkin();
                this.skinCharacter.Apply(this.character);
            }
            if (GUI.Button(new Rect(this.posX + this.width + this.width / 5f, this.posY, this.width / 5, this.width / 5), Resources.Load<Texture2D>("Sprites/Cosmetics/Reset"), skin.GetStyle("Square")))
            {
                try
                {
                    this.categoryCloth = CategoryCloth.None;
                    this.skinCharacter = Skin.Load(PlayerPrefs.GetString("Skin", ""));
                    this.skinCharacter.Apply(this.character);
                }
                catch { }
            }

            switch (this.categoryCloth)
            {
                case CategoryCloth.Hair:
                case CategoryCloth.Eyes:
                case CategoryCloth.Beard:
                case CategoryCloth.Hat:
                    this.firstScene.CameraAim(1);
                    break;
                case CategoryCloth.Gloves:
                    this.firstScene.CameraAim(2);
                    break;
                default:
                    this.firstScene.CameraAim(0);
                    break;
            }

            #endregion

            Text tooltip = null;
            Texture2D fill = new Texture2D(this.width / 3, this.width / 3);
            switch (this.categoryCloth)
            {
                #region Hat
                case (CategoryCloth.Hat):
                    int y = 0;
                    int x = 0;
                    Rect rect = new Rect(Screen.width / 25f, this.posY - this.spacing * 1.5f, Screen.height / 11, Screen.height / 11);
                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/NoneIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Hat.TypeHat.None;
                    }
                    rect.x += (Screen.width / 40 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/HatIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Hat.TypeHat.TopHat;
                    }
                    rect.x += (Screen.width / 40 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/StrawHatIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Hat.TypeHat.StrawHat;
                    }
                    rect.x += (Screen.width / 40 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/CowBoyIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Hat.TypeHat.CowBoy;
                    }

                    foreach (Hat h in Clothing.Hats)
                        if (this.typeCloth == (int)h.GetTypeHat)
                        {
                            x = this.typeCloth;
                            Color fillcolor = h.Color;
                            fillcolor.a = Mathf.Clamp01(this.smoothAparition - y * TransitionDelay);
                            for (int i = 0; i < this.width / 3; i++)
                                for (int j = 0; j < this.width / 3; j++)
                                    fill.SetPixel(i, j, fillcolor);
                            fill.Apply();
                            rect = new Rect((Screen.width / 40 + Screen.width / 20) * x + Screen.width / 25f, y * (Screen.height / 10) + Screen.height / 2.6f, Screen.height / 11, Screen.height / 11);
                            if (rect.Contains(Event.current.mousePosition))
                                tooltip = h.Description;
                            if (this.smoothAparition > y * TransitionDelay && GUI.Button(rect, fill, skin.GetStyle("Square")))
                            {
                                this.skinCharacter.Hat = h;
                                this.skinCharacter.Apply(this.character);
                            }
                            y += 1;
                        }
                    break;
                #endregion
                #region Beard
                case (CategoryCloth.Beard):
                    y = 0;
                    x = 0;
                    rect = new Rect(Screen.width / 25f, this.posY - this.spacing * 1.5f, Screen.height / 11, Screen.height / 11);
                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/NoneIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Beard.TypeBeard.None;
                    }
                    rect.x += (Screen.width / 50 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/BeardIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Beard.TypeBeard.Beard;
                    }
                    rect.x += (Screen.width / 50 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/BeardOnlyIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Beard.TypeBeard.BeardOnly;
                    }
                    rect.x += (Screen.width / 50 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/BeardIcon 1"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Beard.TypeBeard.BeardMoustachSplit;
                    }
                    rect.x += (Screen.width / 50 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/MustacheIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Beard.TypeBeard.Moustach;
                    }

                    foreach (Beard b in Clothing.Beards)
                        if (this.typeCloth == (int)b.GetTypeBeard)
                        {
                            x = this.typeCloth;
                            Color fillcolor = b.Color;
                            fillcolor.a = Mathf.Clamp01(this.smoothAparition - y * TransitionDelay);
                            for (int i = 0; i < this.width / 3; i++)
                                for (int j = 0; j < this.width / 3; j++)
                                    fill.SetPixel(i, j, fillcolor);
                            fill.Apply();
                            rect = new Rect((Screen.width / 50 + Screen.width / 20) * x + Screen.width / 25f, y * (Screen.height / 10) + Screen.height / 2.6f, Screen.height / 11, Screen.height / 11);
                            if (rect.Contains(Event.current.mousePosition))
                                tooltip = b.Description;
                            if (this.smoothAparition > y * TransitionDelay && GUI.Button(rect, fill, skin.GetStyle("Square")))
                            {
                                this.skinCharacter.Beard = b;
                                this.skinCharacter.Apply(this.character);
                            }
                            y += 1;
                        }
                    break;
                #endregion
                #region Body
                case (CategoryCloth.Body):
                    y = 0;
                    x = 0;
                    foreach (Body b in Clothing.Bodies)
                    {
                        Color fillcolor = b.Color;
                        fillcolor.a = Mathf.Clamp01(this.smoothAparition - (x + y * 3) * TransitionDelay);
                        for (int i = 0; i < this.width / 3; i++)
                            for (int j = 0; j < this.width / 3; j++)
                                fill.SetPixel(i, j, fillcolor);
                        fill.Apply();
                        rect = new Rect((Screen.width / 40 + Screen.width / 20) * x + Screen.width / 25f, y * (10 + Screen.height / 10) + Screen.height / 2.25f, Screen.height / 11, Screen.height / 11);
                        if (rect.Contains(Event.current.mousePosition))
                            tooltip = b.Description;
                        if (this.smoothAparition > (x + y * 3) * TransitionDelay && GUI.Button(rect, fill, skin.GetStyle("Square")))
                        {
                            this.skinCharacter.Body = b;
                            this.skinCharacter.Apply(this.character);
                        }
                        x = (x + 1) % 3;
                        if (x == 0)
                            y++;
                    }
                    break;
                #endregion
                #region Hair
                case (CategoryCloth.Hair):
                    y = 0;
                    x = 0;
                    rect = new Rect(Screen.width / 25f, this.posY - this.spacing * 1.5f, Screen.height / 11, Screen.height / 11);
                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/NoneIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Hair.TypeHair.None;
                    }
                    rect.x += (Screen.width / 50 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/HairIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Hair.TypeHair.Normal;
                    }
                    rect.x += (Screen.width / 50 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/PunkHair"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Hair.TypeHair.Crete;
                    }
                    rect.x += (Screen.width / 50 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/LongHair"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Hair.TypeHair.LongHair;
                    }
                    rect.x += (Screen.width / 50 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/WickHair"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Hair.TypeHair.Meche;
                    }

                    foreach (Hair h in Clothing.Hairs)
                    {
                        if (this.typeCloth == (int)h.GetTypeHair)
                        {
                            x = this.typeCloth;
                            Color fillcolor = h.Color;
                            fillcolor.a = Mathf.Clamp01(this.smoothAparition - y * TransitionDelay);
                            for (int i = 0; i < this.width / 3; i++)
                                for (int j = 0; j < this.width / 3; j++)
                                    fill.SetPixel(i, j, fillcolor);
                            fill.Apply();
                            rect = new Rect((Screen.width / 50 + Screen.width / 20) * x + Screen.width / 25f, y * (Screen.height / 10) + Screen.height / 2.6f, Screen.height / 11, Screen.height / 11);
                            if (rect.Contains(Event.current.mousePosition))
                                tooltip = h.Description;
                            if (this.smoothAparition > y * TransitionDelay && GUI.Button(rect, fill, skin.GetStyle("Square")))
                            {
                                this.skinCharacter.Hair = h;
                                this.skinCharacter.Apply(this.character);
                            }
                            y += 1;
                        }
                    }
                    break;
                #endregion
                #region Gloves
                case (CategoryCloth.Gloves):
                    y = 0;
                    x = 0;
                    foreach (Gloves g in Clothing.Gloves)
                    {
                        Color fillcolor = g.Color;
                        fillcolor.a = Mathf.Clamp01(this.smoothAparition - (x + y * 3) * TransitionDelay);
                        for (int i = 0; i < this.width / 3; i++)
                            for (int j = 0; j < this.width / 3; j++)
                                fill.SetPixel(i, j, fillcolor);
                        fill.Apply();
                        rect = new Rect((Screen.width / 40 + Screen.width / 20) * x + Screen.width / 25f, y * (10 + Screen.height / 10) + Screen.height / 2.25f, Screen.height / 11, Screen.height / 11);
                        if (rect.Contains(Event.current.mousePosition))
                            tooltip = g.Description;
                        if (this.smoothAparition > (x + y * 3) * TransitionDelay && GUI.Button(rect, fill, skin.GetStyle("Square")))
                        {
                            this.skinCharacter.Gloves = g;
                            this.skinCharacter.Apply(this.character);
                        }
                        x = (x + 1) % 3;
                        if (x == 0)
                            y++;
                    }
                    break;
                #endregion
                #region Eyes
                case (CategoryCloth.Eyes):
                    y = 0;
                    x = 0;
                    foreach (Eyes e in Clothing.Eyes)
                    {
                        Color fillcolor = e.Color;
                        fillcolor.a = Mathf.Clamp01(this.smoothAparition - (x + y * 3) * TransitionDelay);
                        for (int i = 0; i < this.width / 3; i++)
                            for (int j = 0; j < this.width / 3; j++)
                                fill.SetPixel(i, j, fillcolor);
                        fill.Apply();
                        rect = new Rect((Screen.width / 40 + Screen.width / 20) * x + Screen.width / 25f, y * (10 + Screen.height / 10) + Screen.height / 2.25f, Screen.height / 11, Screen.height / 11);
                        if (rect.Contains(Event.current.mousePosition))
                            tooltip = e.Description;
                        if (this.smoothAparition > (x + y * 3) * TransitionDelay && GUI.Button(rect, fill, skin.GetStyle("Square")))
                        {
                            this.skinCharacter.Eyes = e;
                            this.skinCharacter.Apply(this.character);
                        }
                        x = (x + 1) % 3;
                        if (x == 0)
                            y++;
                    }
                    break;
                #endregion
                #region Pant
                case (CategoryCloth.Pant):
                    y = 0;
                    x = 0;
                    rect = new Rect(Screen.width / 25f, this.posY - this.spacing * 1.5f, Screen.height / 11, Screen.height / 11);
                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/Overalls"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Pant.TypePant.Overalls;
                    }
                    rect.x += (Screen.width / 50 + Screen.width / 20);

                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/PantIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Pant.TypePant.Pant;
                    }

                    foreach (Pant p in Clothing.Pants)
                        if (this.typeCloth == (int)p.GetTypePant)
                        {
                            x = this.typeCloth;
                            Color fillcolor = p.Color;
                            fillcolor.a = Mathf.Clamp01(this.smoothAparition - y * TransitionDelay);
                            for (int i = 0; i < this.width / 3; i++)
                                for (int j = 0; j < this.width / 3; j++)
                                    fill.SetPixel(i, j, fillcolor);
                            fill.Apply();
                            rect = new Rect((Screen.width / 50 + Screen.width / 20) * x + Screen.width / 25f, y * (Screen.height / 10) + Screen.height / 2.6f, Screen.height / 11, Screen.height / 11);
                            if (rect.Contains(Event.current.mousePosition))
                                tooltip = p.Description;
                            if (this.smoothAparition > y * TransitionDelay && GUI.Button(rect, fill, skin.GetStyle("Square")))
                            {
                                this.skinCharacter.Pant = p;
                                this.skinCharacter.Apply(this.character);
                            }
                            y += 1;

                        }
                    break;
                #endregion
                #region TShirt
                case (CategoryCloth.TShirt):
                    y = 0;
                    x = 0;
                    rect = new Rect(Screen.width / 25f, this.posY - this.spacing * 1.5f, Screen.height / 11, Screen.height / 11);
                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/NoneIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Tshirt.TypeTshirt.None;
                    }
                    rect.x += (Screen.width / 50 + Screen.width / 20);
                    if (GUI.Button(rect, Resources.Load<Texture2D>("Sprites/Cosmetics/TshirtIcon"), skin.GetStyle("Square")))
                    {
                        this.smoothAparition = 0;
                        typeCloth = (int)Tshirt.TypeTshirt.TShirt;
                    }
                    foreach (Tshirt t in Clothing.Tshirts)
                        if (this.typeCloth == (int)t.GetTypeTshirt)
                        {
                            x = this.typeCloth;
                            Color fillcolor = t.Color;
                            fillcolor.a = Mathf.Clamp01(this.smoothAparition - y * TransitionDelay);
                            for (int i = 0; i < this.width / 3; i++)
                                for (int j = 0; j < this.width / 3; j++)
                                    fill.SetPixel(i, j, fillcolor);
                            fill.Apply();
                            rect = new Rect((Screen.width / 50 + Screen.width / 20) * x + Screen.width / 25f, y * (Screen.height / 10) + Screen.height / 2.6f, Screen.height / 11, Screen.height / 11);
                            if (rect.Contains(Event.current.mousePosition))
                                tooltip = t.Description;
                            if (this.smoothAparition > y * TransitionDelay && GUI.Button(rect, fill, skin.GetStyle("Square")))
                            {
                                this.skinCharacter.Tshirt = t;
                                this.skinCharacter.Apply(this.character);
                            }
                            y += 1;
                        }
                    break;
                #endregion
                default:
                    break;
            }

            if (tooltip != null)
                GUI.Box(new Rect(Event.current.mousePosition.x - Screen.width / 20, Event.current.mousePosition.y + Screen.height / 20, 100, 35 + 20 * (tooltip.GetText().Length / 15 + 1)),
                               tooltip.GetText(), this.skin.GetStyle("Skin"));
            DestroyImmediate(fill);
        }