I may of missed it in the Script reference. As of right now I am using
system.convert.ToString();
Is there a better way to change an int to a string to be displayed in a label? I'm using C#
I may of missed it in the Script reference. As of right now I am using
system.convert.ToString();
Is there a better way to change an int to a string to be displayed in a label? I'm using C#
int myInt = 7;
GUILayout.Label(myInt.ToString()); // Works
GUILayout.Label(""+myInt); // Also works
// GUILayout.Label((string)myInt); // Compile error as you cannot convert an int to an object
You can just use
yourint.ToString();
e.g.
var i = 5;
Debug.Log(i.ToString());
http://msdn.microsoft.com/en-us/library/system.object.tostring.aspx