Exemplo n.º 1
0
    void UpdateCloth(int idCloth)
    {
        int inActor = actorScript.clothesList.FindIndex(x => x.ClothID == idCloth);

        if (inActor > -1)
        {
            actorScript.RemoveCloth(idCloth, actorScript.actorBody.BodySubtype, true);
        }
        else
        {
            actorScript.AddCloth(idCloth);
        }

        int iIndex = 0;

        for (int i = 0; i < clothList.Count; i++)
        {
            iIndex = actorScript.clothesList.FindIndex(x => x.ClothID == clothList [i].IDCloth);

            Text optText = clothList [i].optObject.GetComponentInChildren <Text> ();

            if (iIndex > -1)
            {
                optText.fontStyle = FontStyle.Bold;
                optText.color     = Color.blue;
            }
            else
            {
                optText.fontStyle = FontStyle.Normal;
                optText.color     = Color.black;
            }
        }
    }