void CreateUI() { if (s_SpatialMenuUI == null) { s_SpatialMenuUI = this.InstantiateUI(m_SpatialMenuUiPrefab.gameObject, CameraUtils.GetCameraRig(), rayOrigin: rayOrigin).GetComponent <SpatialMenuUI>(); s_SpatialMenuUI.spatialMenuData = k_SpatialMenuData; // set shared reference to menu name/type, elements, and highlighted state s_SpatialMenuUI.Setup(); s_SpatialMenuUI.returnToPreviousMenuLevel = ReturnToPreviousMenuLevel; s_SpatialMenuUI.changeMenuState = ChangeMenuState; } visible = false; }
void CreateUI() { if (s_SpatialMenuUI == null) { var parent = CameraUtils.GetCameraRig(); s_SpatialMenuUI = this.InstantiateUI(m_SpatialMenuUiPrefab.gameObject, parent, rayOrigin: rayOrigin).GetComponent <SpatialMenuUI>(); // HACK: For some reason, the spatial menu ends up outside of the VRCameraRig in play mode s_SpatialMenuUI.transform.parent = parent; s_SpatialMenuUI.spatialMenuData = k_SpatialMenuData; // set shared reference to menu name/type, elements, and highlighted state s_SpatialMenuUI.Setup(); s_SpatialMenuUI.returnToPreviousMenuLevel = ReturnToPreviousMenuLevel; s_SpatialMenuUI.changeMenuState = ChangeMenuState; } visible = false; }