31 lines
650 B
C#
31 lines
650 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TouchScript.Gestures;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class touchUI : MonoBehaviour
|
|
{
|
|
public GameObject button;
|
|
// Start is called before the first frame update
|
|
void OnEnable()
|
|
{
|
|
GetComponent<TapGesture>().Tapped += tappedHandler;
|
|
}
|
|
|
|
void OnDisable()
|
|
{
|
|
GetComponent<TapGesture>().Tapped -= tappedHandler;
|
|
}
|
|
|
|
public void onClick()//ÐéÄâµã»÷
|
|
{
|
|
button.GetComponent<Button>().onClick.Invoke();
|
|
}
|
|
void tappedHandler(object sender, EventArgs eventArgs)
|
|
{
|
|
onClick();
|
|
}
|
|
}
|