using UnityEngine;
using System.Collections;
public class TouchLogic : MonoBehaviour
{
void Update ()
{
//is there a touch on screen?
if(Input.touches.Length <= o)
{
//if no touches then execute this code
}
else //if there is a touch
{
//loop through all the touches on screen
for(int i = o; i < Input.touchCount; i++)
{
//execute this code for current touch (i) on screen
if(this.guiTexture.HitTest(Input.GetTouch(i).position))
{
//if current touch hits our guitexture, run this code
if(Inpu.GetTouch(i).phase == TouchPhase.Began)
{
Debug.Log("The Touch has begun on " + this.name)
}
//if current touch hits our guitexture, run this code
if(Inpu.GetTouch(i).phase == TouchPhase.Ended)
{
Debug.Log("The Touch has ended on " + this.name)
}
}
}
}
}
}
↧