using
UnityEngine;
using
System.Collections;
public
class MultiTouch : MonoBehaviour {
public
Texture2D imageBG;
public
Texture2D imageItem;
void
OnGUI()
{
GUI.DrawTexture( new
Rect(0,0,640,960),imageBG);
int
touchCount=Input.touchCount;
for ( int
i=0;i<touchCount;i++)
{
Vector2 touchposition= Input.GetTouch(i).position;
int
x=( int )touchposition.x;
int
y=( int )touchposition.y;
GUI.DrawTexture( new
Rect(x,960-y,120,120),imageItem);
GUI.Label( new
Rect(x,960-y,120,120), "Touch position is " +touchposition);
}
}
// Use this for initialization
void
Start () {
}
// Update is called once per frame
void
Update () {
}
}
|