Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update service framework and remove spatial awareness (moved to own package) #124

Merged
merged 3 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Assets~/Profiles/SpatialAwarenessSystem.meta

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 2 additions & 16 deletions Editor/EditorActiveProfileChangeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.ServiceFramework.Services;
using RealityCollective.Utilities.Editor;
using RealityToolkit.Editor.Utilities;
using RealityToolkit.Input.Interfaces;
using RealityToolkit.SpatialAwareness.Definitions;
using RealityToolkit.SpatialAwareness.Interfaces;
using UnityEditor;
using UnityEngine;

Expand All @@ -24,27 +21,16 @@ private static void EditorApplication_hierarchyChanged()
{
if (ServiceManager.Instance != null && ServiceManager.Instance.HasActiveProfile)
{
if (ServiceManager.Instance.IsServiceEnabled<IInputService>() &&
if (ServiceManager.Instance.TryGetService<IInputService>(out _) &&
InputMappingAxisUtility.CheckUnityInputManagerMappings(ControllerMappingUtilities.UnityInputManagerAxes))
{
Debug.Log($"{nameof(IInputService)} was enabled, updated input axis mappings.");
}
else if (!ServiceManager.Instance.IsServiceEnabled<IInputService>() &&
else if (!ServiceManager.Instance.TryGetService<IInputService>(out _) &&
InputMappingAxisUtility.RemoveMappings(ControllerMappingUtilities.UnityInputManagerAxes))
{
Debug.Log($"{nameof(IInputService)} was disabled, removed input axis mappings.");
}

if (ServiceManager.Instance.IsServiceEnabled<ISpatialAwarenessService>() &&
LayerUtilities.CheckLayers(SpatialAwarenessSystemProfile.SpatialAwarenessLayers))
{
Debug.Log($"{nameof(ISpatialAwarenessService)} was enabled, spatial mapping layers added to project.");
}
else if (!ServiceManager.Instance.IsServiceEnabled<ISpatialAwarenessService>() &&
LayerUtilities.RemoveLayers(SpatialAwarenessSystemProfile.SpatialAwarenessLayers))
{
Debug.Log($"{nameof(ISpatialAwarenessService)} was disabled, spatial mapping layers removed to project.");
}
}
}
}
Expand Down
8 changes: 0 additions & 8 deletions Editor/Profiles/SpatialAwarenessService.meta

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading