private static void CheckMixedRealityToolkitScene() { // If building, don't perform this check if (BuildPipeline.isBuildingPlayer) { return; } // Create The MR Manager if none exists. if (!MixedRealityToolkit.IsInitialized) { // Search the scene for one, in case we've just hot reloaded the assembly. var managerSearch = Object.FindObjectsOfType <MixedRealityToolkit>(); if (managerSearch.Length == 0) { HideNoActiveToolkitWarning = SessionState.GetBool(HideNoActiveToolkitWarningKey, false); if (!HideNoActiveToolkitWarning) { NoActiveToolkitWarning.OpenWindow(null); } return; } } }
protected override void OnEnable() { base.OnEnable(); if (target == null) { // Either when we are recompiling, or the inspector window is hidden behind another one, the target can get destroyed (null) and thereby will raise an ArgumentException when accessing serializedObject. For now, just return. return; } configurationProfile = target as MixedRealityToolkitConfigurationProfile; // Create The MR Manager if none exists. if (!MixedRealityToolkit.IsInitialized) { // Search the scene for one, in case we've just hot reloaded the assembly. var managerSearch = FindObjectsOfType <MixedRealityToolkit>(); if (managerSearch.Length == 0) { HideNoActiveToolkitWarning = SessionState.GetBool(HideNoActiveToolkitWarningKey, false); if (!HideNoActiveToolkitWarning) { NoActiveToolkitWarning.OpenWindow(configurationProfile); } return; } } if (!MixedRealityToolkit.ConfirmInitialized()) { return; } if (!MixedRealityToolkit.Instance.HasActiveProfile) { return; } // Experience configuration targetExperienceScale = serializedObject.FindProperty("targetExperienceScale"); // Camera configuration enableCameraProfile = serializedObject.FindProperty("enableCameraProfile"); cameraProfile = serializedObject.FindProperty("cameraProfile"); // Input system configuration enableInputSystem = serializedObject.FindProperty("enableInputSystem"); inputSystemType = serializedObject.FindProperty("inputSystemType"); inputSystemProfile = serializedObject.FindProperty("inputSystemProfile"); // Boundary system configuration enableBoundarySystem = serializedObject.FindProperty("enableBoundarySystem"); boundarySystemType = serializedObject.FindProperty("boundarySystemType"); boundaryVisualizationProfile = serializedObject.FindProperty("boundaryVisualizationProfile"); // Teleport system configuration enableTeleportSystem = serializedObject.FindProperty("enableTeleportSystem"); teleportSystemType = serializedObject.FindProperty("teleportSystemType"); // Spatial Awareness system configuration enableSpatialAwarenessSystem = serializedObject.FindProperty("enableSpatialAwarenessSystem"); spatialAwarenessSystemType = serializedObject.FindProperty("spatialAwarenessSystemType"); spatialAwarenessSystemProfile = serializedObject.FindProperty("spatialAwarenessSystemProfile"); // Diagnostics system configuration enableDiagnosticsSystem = serializedObject.FindProperty("enableDiagnosticsSystem"); diagnosticsSystemType = serializedObject.FindProperty("diagnosticsSystemType"); diagnosticsSystemProfile = serializedObject.FindProperty("diagnosticsSystemProfile"); // Additional registered components configuration registeredServiceProvidersProfile = serializedObject.FindProperty("registeredServiceProvidersProfile"); }