Files
BlockSpace-v1.5.0b/Assets/Scripts/Assembly-CSharp/IsVRBehavior.cs
T
2026-06-01 17:19:55 +02:00

13 lines
416 B
C#

using UnityEngine;
using UnityEngine.XR;
[DisallowMultipleComponent]
public sealed class IsVRBehavior : NodeBehavior
{
public override void OnGraphUpdate()
{
bool value = InputDevices.GetDeviceAtXRNode(XRNode.Head).isValid || InputDevices.GetDeviceAtXRNode(XRNode.LeftHand).isValid || InputDevices.GetDeviceAtXRNode(XRNode.RightHand).isValid;
SetLocalOutputValueIfChanged("VR", BSValue.FromBool(value));
}
}