This looks like a dumb question, but I really need a solution.
How do you color an integer variable if its called in a text. consider the example below:
int mc;
private void Start()
{
mc = GameObject.FindGameObjectWithTag("MC").GetComponent<MissionCount>().missionCount;
missionBox.GetComponentInChildren<Text>().text = "Your mission is to break " + mc + " Squares";
}
missionCount is an integer value, and I want to change its color to something different. Please help me if you understood the question.
I have missionCount int variable. and I want to add that into a text component of another GameObject. the code above is working fine and is giving me, what I want. But I want to change the color of ‘mc’ in the text. so the result will be:
missionBox.GetComponentInChildren<Text>().text = "Your mission is to break " + mc + " Squares";