8 using UnityEngine.Events;
9 using System.Collections;
11 namespace Valve.VR.InteractionSystem
16 public bool initialized {
get;
private set; }
17 public float playAreaSizeX {
get;
private set; }
18 public float playAreaSizeZ {
get;
private set; }
19 public bool roomscale {
get;
private set; }
30 if ( _instance == null )
32 _instance =
new GameObject(
"[ChaperoneInfo]" ).AddComponent<
ChaperoneInfo>();
33 _instance.initialized =
false;
34 _instance.playAreaSizeX = 1.0f;
35 _instance.playAreaSizeZ = 1.0f;
36 _instance.roomscale =
false;
57 var chaperone = OpenVR.Chaperone;
58 if ( chaperone == null )
60 Debug.LogWarning(
"Failed to get IVRChaperone interface." );
68 float px = 0.0f, pz = 0.0f;
69 if ( chaperone.GetPlayAreaSize( ref px, ref pz ) )
74 roomscale = Mathf.Max( px, pz ) > 1.01f;
76 Debug.LogFormat(
"ChaperoneInfo initialized. {2} play area {0:0.00}m x {1:0.00}m", px, pz, roomscale ?
"Roomscale" :
"Standing" );
78 ChaperoneInfo.Initialized.Send();