Replace UltimateXR with HurricaneVR

This commit is contained in:
2024-08-08 17:01:07 +02:00
parent e8658374d6
commit fb21dbbb73
5932 changed files with 358362 additions and 2174150 deletions

View File

@@ -0,0 +1,39 @@
using System.Linq;
using HurricaneVR.Framework.Core;
using HurricaneVR.Framework.Core.Grabbers;
using HurricaneVR.Framework.Core.HandPoser;
using HurricaneVR.Framework.Shared;
using UnityEngine;
namespace HurricaneVR.TechDemo.Scripts
{
public class DemoCodeGrabbing : MonoBehaviour
{
public HVRHandGrabber Grabber { get; set; }
public HVRGrabbable Grabbable;
public HVRGrabTrigger GrabTrigger;
public HVRPosableGrabPoint GrabPoint;
public void Start()
{
Grabber = GameObject.FindObjectsOfType<HVRHandGrabber>().FirstOrDefault(e => e.gameObject.activeInHierarchy);
}
public void Grab()
{
if (Grabbable && Grabber)
{
if (GrabTrigger == HVRGrabTrigger.ManualRelease && Grabber.GrabbedTarget == Grabbable)
{
Grabber.ForceRelease();
return;
}
//grabber needs to have it's release sequence completed if it's holding something
if(Grabber.IsGrabbing)
Grabber.ForceRelease();
Grabber.Grab(Grabbable, GrabTrigger, GrabPoint);
}
}
}
}