Files
PrinceOfGlory/Assets/Scripts/Scene_02/AnimalCatchCtr.cs
kridoo 6e91a0c7f0 111
2025-09-15 17:32:08 +08:00

75 lines
2.1 KiB
C#

using System.Collections;
using System.Collections.Generic;
using BigSpace.Logic;
using BigSpace.XRCore.Event;
using UnityEngine;
public class AnimalCatchCtr : MonoBehaviour
{
////计时相关
//bool isRun = false;
//float waitTime = 0.3f;
//float runTime = 0;
// Start is called before the first frame update
void Start()
{
//把检测范围传给管理类
MeshCollider controll = GameObject.Find("LeaveBoxCollider_201").GetComponent<MeshCollider>();
AnimalCatchMgr.Instance.SetMeshCollider(controll);
}
//左手获得抓放的手势
public void LeftHandPosCatch(bool isShow)
{
if (isShow)
{
GlobalEventMgr.Dispatch(GameEvent.EventRayStart,1);//1:左手
//Debug.Log("抓取手势识别成功进来了");
}
else
{
//Debug.Log("松开手势识别成功进来了");
//GlobalEventMgr.Dispatch(GameEvent.EventRayQuadOk, false,1);
}
}
//右手获得抓放的手势
public void RightHandPosCatch(bool isShow)
{
if (isShow)
{
GlobalEventMgr.Dispatch(GameEvent.EventRayStart,2);//2:右手
//Debug.Log("抓取手势识别成功进来了");
}
else
{
//Debug.Log("松开手势识别成功进来了");
//GlobalEventMgr.Dispatch(GameEvent.EventRayQuadOk, false,2);
}
}
//左手抓取手势手掌向上
public void LeftHandCatchPalmUp(bool isShowFont)
{
if (isShowFont)
{
Debug.Log("手势向上获取到:"+ AnimalCatchMgr.Instance.leftHandIsCatchObj);
//if(AnimalCatchMgr.Instance.handIsCatchObj)
GlobalEventMgr.Dispatch(GameEvent.EventHandShowFont,1, AnimalCatchMgr.Instance.leftAnimalType);
}
}
//右手抓取手势手掌向上
public void RightHnadCatchPalmUp(bool isShowFont)
{
if (isShowFont)
{
Debug.Log("手势向上获取到:" + AnimalCatchMgr.Instance.rightHandIsCatchObj);
//if(AnimalCatchMgr.Instance.handIsCatchObj)
GlobalEventMgr.Dispatch(GameEvent.EventHandShowFont,2, AnimalCatchMgr.Instance.rightAnimalType);
}
}
}