I'm attempting to create a custom GUI from an Illustrator file which will control character movement. Here is a sample of the script I'm attempting to build:
// GUI active elements:
var dPadTexture : Texture2D;
var position : Rect;
function OnGUI () {
GUI.DrawTexture( position, dPadTexture );
GUI.Button(position, dPadTexture);
}
My question is how to draw a Texture2D in the GUI and have it also function as a button, basically just creating a custom button graphic that inputs as a mouseEvent telling the character to move.
I can't really tell what you're asking. Your DrawTexture doesn't look like it's helping anything. And you need an if statement around your button code, if you want it to be functional and not just graphical.