void Start() { if (vertices == null || vertices.Length == 0) { bool success = SteamVR_PlayArea.GetBounds(steamVR_PlayArea.size, ref steamVrBounds); if (success) { lastSize = steamVR_PlayArea.size; BuildMesh(); } else { Debug.LogWarning("Could not get the chaperon size. This may happen if you use the calibrated size."); } } }
private void checkAndUpdateBounds() { if (lastSize != steamVR_PlayArea.size) { bool success = SteamVR_PlayArea.GetBounds(steamVR_PlayArea.size, ref steamVrBounds); if (success) { lastSize = steamVR_PlayArea.size; } else { Debug.LogWarning("Could not get the Play Area bounds. " + steamVR_PlayArea.size); } } }
void OnEnable() { steamVR_PlayArea = GameObject.FindObjectOfType<SteamVR_PlayArea>(); vrtk_RoomExtender = GameObject.FindObjectOfType<VRTK_RoomExtender>(); if (steamVR_PlayArea == null || vrtk_RoomExtender == null) { Debug.LogWarning("Could not find 'SteamVR_PlayArea' or 'VRTK_RoomExtender'. Please check if they are attached to the 'CameraRig'"); return; } bool success = SteamVR_PlayArea.GetBounds(steamVR_PlayArea.size, ref steamVrBounds); if (success) { lastSize = steamVR_PlayArea.size; BuildMesh(); } else { Debug.LogWarning("Could not get the Calibrated Play Area bounds. This script 'RoomExtender_PlayArea' tries to get the size when SteamVR is running."); } }