Hey all, i have a “combat window” in my game, and i want to change the “destroyedName” color to red, and the “attackerName” to blue, but i cant figure out how to do this…
Here is my code:
//unity code
public string attackerName;
public string destroyedName;
private string combatLog;
public GUIStyle myStyle = new GUIStyle();
void Start ()
{
myStyle.fontStyle = FontStyle.Bold;
myStyle.fontSize = 11;
myStyle.normal.textColor = Color.red;
}
void CombatWindowFunction (int windowID)
{
GUILayout.Label(combatLog);
}
void OnGUI ()
{
if (attackerName !="")
{
combatLog = attackerName + " killed " + destroyedName + "
" + combatLog;
}
}
}