Create custom button for ios

Hi guys :slight_smile: , I am trying to create a custom button for example a fire button for unity … I don’t know how can I to do so :

for example I have GUI texture like button and should be a fire with touch

function Update () {
	
	
	for (var touch : Touch in Input.touches) {
		
		if (touch.phase == TouchPhase.Began) {
			
		// if the button == myButton  ,, the button do something
	}
}

I really need the answer is there some to help me ? I don’t think so this is hard question !

If you button is a GUIElement try this : GUIElement.HitTest

if not you can define a rect and you this : Rect.Contains

i use this

function Update () {
	if (Input.touchCount > 0 ) {
		for (var i : int = 0; i< Input.touchCount; i++) {
			var touch : Touch = Input.GetTouch(i);
			if (touch.phase == TouchPhase.Began  guiTexture.HitTest(touch.position)) {	
				// do something
				return;
			}
		}
	}
}

I recommend checking out Prime31’s UIToolkit. There is a large thread on the first page.

Great Idea ! but is this support Java or just C# ?