Using the new Unity4.6 UI System;
I’ve got a Text type loaded onto a canvas that I need to update with a string. In attempting to update a text component as follows;
myObject.getComponent<Text>().text = passedString;
I’m sent back an error stating that a String type cannot be implicitly converted to a Text type. Casting passedString manually also doesn’t make any difference.
I’ve found I can actually hack around it with;
myObject.getComponent<Text>().text = "" + passedString;
But this at least, looks like terrible practice.
Could anyone let me know what the correct way of converting a String to a text type is?