Aggenttom, on that page i really can’t fine a solution.
Also i need an event like i can choose out of 10 buttons.
So i think that turtorial isn’t that great if you want to do what i want.
Ty, already for helping.
var menu : GUITexture;
var i = 0;
function Update ()
{
for (var touch : Touch in Input.touches)
{
if(touch.phase == TouchPhase.Stationary && menu.HitTest (touch.position)){
Application.LoadLevel(i);
}
}
}
This script adds function OnTouch it acts like function OnMouseDown
`
// Call this OnTouchDown.cs
// Allows “OnMouseDown()” events to work on the iPhone.
// Attach to the main camera.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class OnTouchDown : MonoBehaviour
{
void Update () {
// Code for OnMouseDown in the iPhone. Unquote to test.
RaycastHit hit = new RaycastHit();
for (int i = 0; i < Input.touchCount; ++i) {
if (Input.GetTouch(i).phase.Equals(TouchPhase.Began)) {
// Construct a ray from the current touch coordinates
Ray ray = Camera.main.ScreenPointToRay(Input.GetTouch(i).position);
if (Physics.Raycast(ray, out hit)) {
hit.transform.gameObject.SendMessage(“OnTouch”);
}
}
}
}
}
`