Skip to content

Commit

Permalink
Service framework update and misc updates (#122)
Browse files Browse the repository at this point in the history
* Handle Unity 6 change

* Define stubs for custom interaction behaviour inspectors

* Add support for rotation lever going from positive into negative rotation

* Introduce InteractorTrackingMode setting

* Add all interaction components to custom AddComponent menu group

* Update assembly infos and restore SF compat

* Update SF to v1.0.7

* Update package.json with docs link

* Working on new home for toolkit project settings

* Fix ScriptableSettingsPath

* Remopve legacy RealityToolkitEditorSettings

* Load settings editor from UXML

* Add input system dependency

* Fix ISpatialAwarenessServiceModule base type

* Kick rebuild

* Removing "player" from build dependencies

---------

Co-authored-by: SimonDarksideJ <[email protected]>
  • Loading branch information
FejZa and SimonDarksideJ authored May 7, 2024
1 parent 5048b93 commit b83b5b2
Show file tree
Hide file tree
Showing 203 changed files with 1,599 additions and 690 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/development-buildandtestupmrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
uses: realitycollective/reusableworkflows/.github/workflows/rununityUPMbuild.yml@v2
with:
unityversion: ${{ needs.Validate-Unity.outputs.unityeditorversion }}
dependencies: '[{"development": "github.com/realitycollective/com.realitycollective.buildtools.git"},{"development": "github.com/realitycollective/com.realitycollective.utilities.git"},{"development": "github.com/realitycollective/com.realitycollective.service-framework.git"},{"development": "github.com/realitycollective/com.realitytoolkit.player.git"}]'
dependencies: '[{"development": "github.com/realitycollective/com.realitycollective.buildtools.git"},{"development": "github.com/realitycollective/com.realitycollective.utilities.git"},{"development": "github.com/realitycollective/com.realitycollective.service-framework.git"}]'
secrets: inherit
4 changes: 1 addition & 3 deletions Editor/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#define REALITYTOOLKIT_EDITOR

using System.Reflection;

[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyTitle("com.realitytoolkit.core.editor")]
[assembly: AssemblyCompany("RealityCollective")]
[assembly: AssemblyCompany("Reality Collective")]
[assembly: AssemblyCopyright("Copyright (c) Reality Collective. All rights reserved.")]
8 changes: 4 additions & 4 deletions Editor/BuildPipeline/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Reflection;

[assembly: AssemblyVersion("0.3.0")]
[assembly: AssemblyTitle("com.xrtk.editor.buildpipeline")]
[assembly: AssemblyCompany("XRTK")]
[assembly: AssemblyCopyright("Copyright (c) XRTK. All rights reserved.")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyTitle("com.realitytoolkit.editor.buildpipeline")]
[assembly: AssemblyCompany("Reality Collective")]
[assembly: AssemblyCopyright("Copyright (c) Reality Collective. All rights reserved.")]
2 changes: 1 addition & 1 deletion Editor/BuildPipeline/BuildDeployPreferences.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.Editor.Utilities;
using RealityCollective.ServiceFramework.Definitions.Platforms;
using RealityCollective.Utilities.Editor;
using System;
using System.IO;
using UnityEditor;
Expand Down
2 changes: 1 addition & 1 deletion Editor/BuildPipeline/BuildDeployWindow.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.Extensions;
using RealityCollective.ServiceFramework.Definitions.Platforms;
using RealityCollective.ServiceFramework.Editor.Utilities;
using RealityCollective.ServiceFramework.Interfaces;
using RealityCollective.ServiceFramework.Services;
using RealityCollective.Utilities.Extensions;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
4 changes: 2 additions & 2 deletions Editor/BuildPipeline/BuildInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Reality Collective. All rights reserved.
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.ServiceFramework.Attributes;
Expand Down Expand Up @@ -36,7 +36,7 @@ public bool AutoIncrement
}

[SerializeField]
[Tooltip("The bundle or application identifier\n(i.e. 'com.xrtk.core')")]
[Tooltip("The bundle or application identifier\n(i.e. 'com.realitytoolkit.core')")]
private string bundleIdentifier;

/// <inheritdoc />
Expand Down
6 changes: 3 additions & 3 deletions Editor/BuildPipeline/IBuildInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Reality Collective. All rights reserved.
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.ServiceFramework.Interfaces;
Expand All @@ -24,7 +24,7 @@ public interface IBuildInfo
bool AutoIncrement { get; set; }

/// <summary>
/// The build Bundle Identifier (i.e. 'com.xrtk.core')
/// The build Bundle Identifier (i.e. 'com.realitytoolkit.core')
/// </summary>
string BundleIdentifier { get; set; }

Expand Down Expand Up @@ -114,7 +114,7 @@ public interface IBuildInfo
/// -autoIncrement<para/>
/// -versionName "0.1.0"<para/>
/// -versionCode "1"<para/>
/// -bundleIdentifier "com.xrtk.core"<para/>
/// -bundleIdentifier "com.realitytoolkit.core"<para/>
/// -sceneList (CSV format)<para/>
/// -sceneListFile (CSV format)<para/>
/// -buildOutputDirectory <para/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "RealityToolkit.Editor.BuildPipeline",
"rootNamespace": "XRTK.Editor.BuildPipeline",
"rootNamespace": "RealityToolkit.Editor.BuildPipeline",
"references": [
"GUID:f3241d040533491e8a1e2714b27c3111",
"GUID:e67d30660ec243e4836aac191d3f36fb",
"GUID:b2d046948d6452a4b8485efc9ce0f88c",
"GUID:2a3f0ca4e21332c44bfdce311ea8943e",
"GUID:13703f41b24bb904cb2305abe6317e3d",
"GUID:9753fcbb5b1feaf459f435ac95e51baa"
"GUID:9753fcbb5b1feaf459f435ac95e51baa",
"GUID:4ddd23ea56a3a40f0aa0036d1624a53e"
],
"includePlatforms": [
"Editor"
Expand Down
10 changes: 5 additions & 5 deletions Editor/BuildPipeline/UnityPlayerBuildTools.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) Reality Collective. All rights reserved.
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using JetBrains.Annotations;
using RealityCollective.Editor.Extensions;
using RealityCollective.Editor.Utilities;
using RealityCollective.Extensions;
using RealityCollective.ServiceFramework.Attributes;
using RealityCollective.Utilities.Editor;
using RealityCollective.Utilities.Extensions;
using RealityToolkit.Editor.BuildPipeline.Logging;
using RealityToolkit.Editor.Settings;
using RealityToolkit.Editor.Utilities.SymbolicLinks;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -132,7 +132,7 @@ public static IBuildInfo BuildInfo
return null;
}

var buildAsset = buildInfoInstance.GetOrCreateAsset($"{RealityToolkitPreferences.ProfileGenerationPath}{Path.DirectorySeparatorChar}BuildInfo{Path.DirectorySeparatorChar}");
var buildAsset = buildInfoInstance.GetOrCreateAsset($"{RealityToolkitEditorSettings.Instance.AssetImportPath}{Path.DirectorySeparatorChar}BuildInfo{Path.DirectorySeparatorChar}");
Debug.Assert(buildAsset.IsNotNull());
buildInfo = buildInfoInstance;
Debug.Assert(buildInfo != null);
Expand Down
4 changes: 2 additions & 2 deletions Editor/ControllerPopupWindow.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.Definitions.Utilities;
using RealityCollective.Extensions;
using RealityCollective.Utilities.Extensions;
using RealityToolkit.Definitions.Controllers;
using RealityToolkit.Editor.Data;
using RealityToolkit.Editor.PropertyDrawers;
using RealityToolkit.Editor.Utilities;
using RealityToolkit.Input.Controllers.UnityInput;
using RealityToolkit.Input.Definitions;
using RealityToolkit.Input.Hands;
using System;
using System.Collections.Generic;
Expand Down
19 changes: 10 additions & 9 deletions Editor/CorePackageInstaller.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.Editor.Extensions;
using RealityCollective.Editor.Utilities;
using RealityCollective.Extensions;
using RealityCollective.Utilities.Extensions;
using RealityCollective.ServiceFramework;
using RealityCollective.ServiceFramework.Definitions;
using RealityCollective.ServiceFramework.Editor;
Expand All @@ -14,6 +12,9 @@
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
using RealityCollective.Utilities.Editor;
using RealityToolkit.Editor.Settings;


#if UNITY_EDITOR && !UNITY_2021_1_OR_NEWER
using SceneManagement = UnityEditor.Experimental.SceneManagement;
Expand All @@ -30,7 +31,7 @@ namespace RealityToolkit.Editor
internal static class CorePackageInstaller
{
private const string CORE_PATH_FINDER = "/Editor/Utilities/CorePathFinder.cs";
private static readonly string defaultPath = $"{RealityToolkitPreferences.ProfileGenerationPath}Core";
private static readonly string defaultPath = Path.Combine(RealityToolkitEditorSettings.Instance.AssetImportPath, "Core");
private static readonly string hiddenPath = Path.GetFullPath($"{PathFinderUtility.ResolvePath<IPathFinder>(typeof(CorePathFinder))}{Path.DirectorySeparatorChar}{RealityToolkitPreferences.HIDDEN_PACKAGE_ASSETS_PATH}");
const string configureMenuItemPath = RealityToolkitPreferences.Editor_Menu_Keyword + "/Configure...";

Expand Down Expand Up @@ -74,12 +75,12 @@ public async static void ConfigureToolkitAsync()
};
}

private static ServiceManagerInstance SetupServiceManager()
private static GlobalServiceManager SetupServiceManager()
{
#if UNITY_2023_1_OR_NEWER
var serviceManagerInstance = Object.FindFirstObjectByType<ServiceManagerInstance>();
var serviceManagerInstance = Object.FindFirstObjectByType<GlobalServiceManager>();
#else
var serviceManagerInstance = Object.FindObjectOfType<ServiceManagerInstance>();
var serviceManagerInstance = Object.FindObjectOfType<GlobalServiceManager>();
#endif
if (serviceManagerInstance.IsNotNull() &&
serviceManagerInstance.Manager != null &&
Expand All @@ -92,7 +93,7 @@ private static ServiceManagerInstance SetupServiceManager()

if (serviceManagerInstance.IsNull())
{
serviceManagerInstance = new GameObject(nameof(ServiceManagerInstance)).AddComponent<ServiceManagerInstance>();
serviceManagerInstance = new GameObject(nameof(GlobalServiceManager)).AddComponent<GlobalServiceManager>();
}

if (serviceManagerInstance.Manager == null)
Expand All @@ -106,7 +107,7 @@ private static ServiceManagerInstance SetupServiceManager()
if (availableRootProfiles == null || availableRootProfiles.Length == 0)
{
var newProfile = ScriptableObject.CreateInstance<ServiceProvidersProfile>().GetOrCreateAsset(
RealityToolkitPreferences.DEFAULT_GENERATION_PATH,
RealityToolkitEditorSettings.Instance.AssetImportPath,
$"RealityToolkit{nameof(ServiceProvidersProfile)}", false);
serviceManagerInstance.Manager.ResetProfile(newProfile);
}
Expand Down
2 changes: 1 addition & 1 deletion Editor/Data/ControllerInputActionOption.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityToolkit.Input.Definitions;
using System;
using RealityCollective.Definitions.Utilities;
using UnityEngine;

namespace RealityToolkit.Editor.Data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.Definitions.Utilities;
using RealityCollective.Editor.Extensions;
using RealityCollective.ServiceFramework.Editor.Profiles;
using RealityCollective.ServiceFramework.Editor.Utilities;
using RealityToolkit.Input.Definitions;
using RealityToolkit.Input.Hands;
using RealityToolkit.Input.Hands.Extensions;
using RealityToolkit.Input.Hands.Poses;
Expand Down
4 changes: 2 additions & 2 deletions Editor/EditorActiveProfileChangeHandler.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Reality Collective. All rights reserved.
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.Editor.Utilities;
using RealityCollective.ServiceFramework.Services;
using RealityCollective.Utilities.Editor;
using RealityToolkit.Editor.Utilities;
using RealityToolkit.Input.Interfaces;
using RealityToolkit.SpatialAwareness.Definitions;
Expand Down
55 changes: 55 additions & 0 deletions Editor/EditorAssemblyReloadManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEditor;
using UnityEngine;

namespace RealityToolkit.Editor
{
public static class EditorAssemblyReloadManager
{
private static bool locked = false;

/// <summary>
/// Locks the Editor's ability to reload assemblies.<para/>
/// </summary>
/// <remarks>
/// This is useful for ensuring async tasks complete in the editor without having to worry if any script
/// changes that happen during the running task will cancel it when the editor re-compiles the assemblies.
/// </remarks>
public static bool LockReloadAssemblies
{
set
{
locked = value;

if (locked)
{
EditorApplication.LockReloadAssemblies();

if (!Application.isBatchMode)
{
EditorWindow.focusedWindow.ShowNotification(new GUIContent("Assembly reloading temporarily paused."));
}
}
else
{
EditorApplication.UnlockReloadAssemblies();
EditorApplication.delayCall += () =>
{
if (!EditorApplication.isUpdating)
{
AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate);
}
};

if (!Application.isBatchMode)
{
EditorWindow.focusedWindow.ShowNotification(new GUIContent("Assembly reloading resumed."));
}
}
}
get => locked;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Editor/Input/Handlers/SpeechInputHandlerInspector.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.Editor.Extensions;
using RealityCollective.Utilities.Editor;
using RealityToolkit.Input.Definitions;
using RealityToolkit.Input.Handlers;
using System.Collections.Generic;
Expand Down
6 changes: 3 additions & 3 deletions Editor/Input/Hands/Poses/HandPoseInspector.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Reality Collective. All rights reserved.
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.Definitions.Utilities;
using RealityToolkit.Editor.Utilities;
using RealityToolkit.Input.Definitions;
using RealityToolkit.Input.Hands.Poses;
using UnityEditor;
using UnityEngine.UIElements;
Expand Down Expand Up @@ -39,7 +39,7 @@ public override VisualElement CreateInspectorGUI()
posesListView.style.flexGrow = 1;

inspector.Add(posesListView);
inspector.Add(UIElementsUtilities.Space());
inspector.Add(UIElementsUtilities.VerticalSpace());
inspector.Add(new Button(Mirror) { text = "Create Mirror Pose" });

return inspector;
Expand Down
6 changes: 3 additions & 3 deletions Editor/Input/Hands/Poses/HandPoseRecorderInspector.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Reality Collective. All rights reserved.
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.Definitions.Utilities;
using RealityToolkit.Editor.Utilities;
using RealityToolkit.Input.Definitions;
using RealityToolkit.Input.Hands.Poses;
using UnityEditor;
using UnityEditor.UIElements;
Expand Down Expand Up @@ -33,7 +33,7 @@ public override VisualElement CreateInspectorGUI()
};

inspector.Add(serializedPoseField);
inspector.Add(UIElementsUtilities.Space());
inspector.Add(UIElementsUtilities.VerticalSpace());
inspector.Add(new Button(Convert) { text = "Convert" });
inspector.Add(new Button(Record) { text = "Record" });

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Reality Collective. All rights reserved.
// Copyright (c) Reality Collective. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using RealityCollective.Definitions.Utilities;
using RealityToolkit.Editor.Utilities;
using RealityToolkit.Input.Definitions;
using RealityToolkit.Input.Hands.Poses;
using UnityEditor;
using UnityEditor.UIElements;
Expand Down Expand Up @@ -38,7 +38,7 @@ public override VisualElement CreateInspectorGUI()

inspector.Add(frameField);
inspector.Add(serializedPoseField);
inspector.Add(UIElementsUtilities.Space());
inspector.Add(UIElementsUtilities.VerticalSpace());
inspector.Add(new Button(Preview) { text = "Preview" });

return inspector;
Expand Down
8 changes: 8 additions & 0 deletions Editor/Inspectors.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b83b5b2

Please sign in to comment.