Exemplo n.º 1
0
    public void ApplyProp(int idProp)
    {
        int inActor = actorScript.propsList.FindIndex(x => x.IDProp == idProp);

        if (inActor > -1)
        {
            actorScript.RemoveProp(idProp);
        }
        else
        {
            actorScript.AddProp(idProp);
        }

        int iIndex = 0;

        for (int i = 0; i < propList.Count; i++)
        {
            iIndex = actorScript.propsList.FindIndex(x => x.IDProp == propList[i].IDProp);

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

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