using BigSpace.Logic; using BigSpace.XRCore.Event; using System.Collections; using System.Collections.Generic; using UnityEngine; public class HandCatchFontCtr : MonoBehaviour { ////计时相关 //bool isLeftStartStay = false; //float leftWaitTime = 1f; //float leftRunTime = 0; //计时相关 bool isRightStartStay = false; float rightWaitTime = 0.5f; float rightRunTime = 0; //左手获得抓放的手势 public void LeftHandPosCatch(bool isShow) { //if (isShow) //{ // isLeftStartStay = true; // //Debug.Log("抓取手势识别成功进来了"); //} } public void LeftHandPosCatchStay(bool istrue) { //if (isLeftStartStay) //{ // //Debug.Log("左手保持手势中......................"); // leftRunTime += Time.deltaTime; // if (leftRunTime >= leftWaitTime) // { // isLeftStartStay = false; // GlobalEventMgr.Dispatch(GameEvent.EventRayStart, 1);//1:左手 // } //} } public void LeftHandPosCatchEnd(bool isShow) { //isLeftStartStay = false; //GlobalEventMgr.Dispatch(GameEvent.EventHandRelease,1); } //右手获得抓放的手势 public void RightHandPosCatch(bool isShow) { if (isShow) { isRightStartStay = true; //Debug.Log("抓取手势识别成功进来了"); } } public void RightHandPosCatchStay(bool istrue) { if (isRightStartStay) { //Debug.Log("右手保持手势中......................"); rightRunTime += Time.deltaTime; if (rightRunTime >= rightWaitTime) { isRightStartStay = false; GlobalEventMgr.Dispatch(GameEvent.EventRayStart, 2);//2:右手 } } } public void RightHandPosCatchEnd(bool isShow) { isRightStartStay = false; GlobalEventMgr.Dispatch(GameEvent.EventHandRelease,2); } }