06-16-2021 07:29 PM
Hi,
I'm developing a roomscale game and I use OVRManager.boundary.GetGeometry(OVRBoundary.BoundaryType.OuterBoundary) to create a custom in-game visible boundary so that the player can align their playspace to the in-game playspace as they like. As part of this process they may decide to update their guardian, but then the geometry I previously fetched is out of date. One way to solve this would be to have an in-game way for the player to reset the in-game boundary and I would then just refetch the boundary. However, I'd prefer to automatically detect any change. I can't for the life of me find an efficient way to do this or any events.
My other thought is to just re-fetch and re-build the in-game boundary every couple of seconds but that also feels a bit lame 🙂
Help!
Solved! Go to Solution.
06-17-2021 09:27 AM
To adjust the guardian the running application has to lose input focus. I think you could just verify the boundary every time the application gains input focus?
public class FocusTest : MonoBehaviour {
private void Awake() {
OVRManager.InputFocusAcquired += OnInputFocusAcquired;
}
private void OnDestroy() {
OVRManager.InputFocusAcquired -= OnInputFocusAcquired;
}
private void OnInputFocusAcquired() {
Debug.Log("Verify boundary.");
}
private void OnApplicationFocus(bool hasFocus) {
if (hasFocus) {
Debug.Log("This might work too.");
}
}
}
06-17-2021 09:27 AM
To adjust the guardian the running application has to lose input focus. I think you could just verify the boundary every time the application gains input focus?
public class FocusTest : MonoBehaviour {
private void Awake() {
OVRManager.InputFocusAcquired += OnInputFocusAcquired;
}
private void OnDestroy() {
OVRManager.InputFocusAcquired -= OnInputFocusAcquired;
}
private void OnInputFocusAcquired() {
Debug.Log("Verify boundary.");
}
private void OnApplicationFocus(bool hasFocus) {
if (hasFocus) {
Debug.Log("This might work too.");
}
}
}
06-17-2021 01:07 PM
Thank you so much! I'm pretty new to all of this and that's a wonderful solution. You totally made my day, thanks!! 🙂