Files
ZeroVR/ZeroPacientVR/Assets/HurricaneVR/TechDemo/Scripts/DemoHolster.cs
T
2022-04-18 19:17:20 +03:00

25 lines
897 B
C#

using HurricaneVR.Framework.Core;
using HurricaneVR.Framework.Core.Grabbers;
using UnityEngine;
namespace HurricaneVR.TechDemo.Scripts
{
public class DemoHolster : HVRSocket
{
protected override Quaternion GetRotationOffset(HVRGrabbable grabbable)
{
var orientation = grabbable.GetComponent<DemoHolsterOrientation>();
if (orientation && orientation.Orientation)
return orientation.Orientation.localRotation;
return base.GetRotationOffset(grabbable);
}
protected override Vector3 GetPositionOffset(HVRGrabbable grabbable)
{
var orientation = grabbable.GetComponent<DemoHolsterOrientation>();
if (orientation && orientation.Orientation)
return orientation.Orientation.localPosition;
return base.GetPositionOffset(grabbable);
}
}
}