using System.Collections; using System.Collections.Generic; using UnityEngine; using Vuforia; public class ImageCS : MonoBehaviour, Vuforia.IVirtualButtonEventHandler { // Start is called before the first frame update void Start() { VirtualButtonBehaviour[] vbs = GetComponentsInChildren(); for (int i = 0; i < vbs.Length; i++) { vbs[i].RegisterEventHandler(this); } } // Update is called once per frame void Update() { } public void OnButtonPressed(VirtualButtonBehaviour vb) { print(vb.name + " 按鈕被按下"); } public void OnButtonReleased(VirtualButtonBehaviour vb) { print(vb.name + " 按鈕被放開"); } }