On Unity’s GUI Basics page it give this code:
/* Texture2D Content example */
var controlTexture : Texture2D;
function OnGUI () {
GUI.Label (Rect (0,0,100,50), controlTexture);
}
My question is how to do I declare a Texture2D public variable for use in this script? I’m trying to get it to display an image.
I hope I explained it clearly, any help is appreciated
Update:
Perhaps the solution is similar to this?
controlTexture.LoadImage(imageTextAsset.bytes);
But now, how do I reference the image I want to be loaded?