Replace UltimateXR with HurricaneVR
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using Assets.HurricaneVR.Framework.Shared.Utilities;
|
||||
using HurricaneVR.Framework.Core;
|
||||
using HurricaneVR.Framework.Core.Grabbers;
|
||||
|
||||
namespace HurricaneVR.Framework.Weapons.Bow
|
||||
{
|
||||
public class HVRArrowPassthrough : HVRGrabbable
|
||||
{
|
||||
public HVRGrabbable Arrow;
|
||||
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
|
||||
if (!Arrow && transform.parent)
|
||||
{
|
||||
Arrow = transform.parent.GetComponentInParent<HVRGrabbable>();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnGrabbed(HVRGrabberBase grabber)
|
||||
{
|
||||
grabber.ForceRelease();
|
||||
if (Arrow)
|
||||
{
|
||||
grabber.AllowGrabbing = false;
|
||||
this.ExecuteNextUpdate(() =>
|
||||
{
|
||||
grabber.TryGrab(Arrow, true);
|
||||
grabber.AllowGrabbing = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user