I’m trying to change text color by using a scriptable object called ‘speaker’. I can update the text just by doing
Text.text = "text"
but whenever I try to change the color value it just disappears and I cannot get it back by changing values from inspector. How can I change the color by not messing up with the text?
Here’s the code:
public TextMeshProUGUI barText;
public TextMeshProUGUI personNameText;
personNameText.text = currentScene.sentences[sentenceIndex].speaker.name;
personNameText.color = currentScene.sentences[sentenceIndex].speaker.textColor;
Debug.Log(personNameText.color);