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,36 @@
using HurricaneVR.Framework.Core;
using HurricaneVR.Framework.Core.Grabbers;
using UnityEngine;
namespace HurricaneVR.Framework.Weapons.Bow
{
[RequireComponent(typeof(HVRPhysicsBow))]
public class HVRArrowLoader : MonoBehaviour
{
public HVRGrabbable NockGrabbable;
public GameObject ArrowPrefab;
public HVRPhysicsBow bow { get; private set; }
public void Start()
{
bow = GetComponent<HVRPhysicsBow>();
if (NockGrabbable)
{
NockGrabbable.HandGrabbed.AddListener(OnStringGrabbed);
}
}
private void OnStringGrabbed(HVRHandGrabber hand, HVRGrabbable arg1)
{
if (!bow.ArrowNocked && ArrowPrefab)
{
var go = Instantiate(ArrowPrefab);
var arrow = go.GetComponent<HVRArrow>();
bow.NockArrow(arrow);
hand.DisableHandCollision(arrow.Grabbable);
}
}
}
}