VR4Medical/ICI/Library/PackageCache/com.unity.xr.openxr@3903c1059bcf/Samples~/InterceptFeature/InterceptMessageHandler.cs
2025-07-29 13:45:50 +03:00

24 lines
790 B
C#

namespace UnityEngine.XR.OpenXR.Samples.InterceptFeature
{
/// <summary>
/// Ensures that the intercept feature is enabled and updates the message on screen
/// with the message received from the intercepted xrCreateSession call.
/// </summary>
public class InterceptMessageHandler : MonoBehaviour
{
public TextMesh textMesh;
private void Start()
{
var feature = OpenXRSettings.Instance.GetFeature<InterceptCreateSessionFeature>();
if (feature == null || !feature.enabled)
textMesh.text = "InterceptCreateSession feature not enabled";
else
{
textMesh.text = feature.receivedMessage;
textMesh.color = Color.white;
}
}
}
}