Less code for same thing

Hi all, thanks for reading the question.
I can’t seem to find a way to Access the .text property of the textmesh without doing all this typing… there’s got to be a shorter way.

GameObject objCategoryLabel = Instantiate(Resources.Load("CategoryLabel"), new Vector3(0,0,0), Quaternion.identity) as GameObject;
TextMesh catLabel = new TextMesh();
catLabel = objCategoryLabel.GetComponent<TextMesh>();
catLabel.text = "At lasttt.....";

For extra points :slight_smile: - does it make any difference at runtime? meaning, is your optimized code also less resource (mem/cpu) intensive?


No takers? i thought this would be an interesting contest… too easy?