Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.UI;
- public abstract class TwoTap: MonoBehaviour {
- Touch[] phases;
- public int amountTouches = 0;
- public float timerTouch;
- void Update ()
- {
- phases = Input.touches;
- timerTouch += Time.deltaTime;
- if (phases.Length > 0 && phases[0].phase == TouchPhase.Ended)
- {
- amountTouches++;
- if (amountTouches == 1)
- timerTouch = 0;
- if (amountTouches > 1 && timerTouch > 1)
- amountTouches = 0;
- if (amountTouches == 2 && timerTouch <= 1)
- {
- //AĆĆO QUE VAI ACONTECER QUANDO DER DOIS TOQUES//
- amountTouches = 0;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement