Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- [RequireComponent (typeof (GUITexture))]
- public class TouchButton : MonoBehaviour {
- public GUITexture theButton;
- void Update () {
- if (Input.touchCount > 0) {
- foreach (Touch touch in Input.touches) {
- if (theButton.HitTest(touch.position)) {
- DoSomething();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement