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)); } }