From fd7161e7d0db056dd2821c209d52771c6ff79616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Fri, 5 Jul 2024 11:41:21 +0200 Subject: [PATCH] Remove VisionOS platform definition (is defined in SF) --- Editor/RealityToolkit.VisionOS.Editor.asmdef | 6 +- Editor/VisionOSPackageInstaller.cs | 4 +- .../Rigs/VisionOSPlayerRigServiceModule.cs | 1 + Runtime/VisionOSPlatform.cs | 81 ------------------- Runtime/VisionOSPlatform.cs.meta | 11 --- 5 files changed, 7 insertions(+), 96 deletions(-) delete mode 100644 Runtime/VisionOSPlatform.cs delete mode 100644 Runtime/VisionOSPlatform.cs.meta diff --git a/Editor/RealityToolkit.VisionOS.Editor.asmdef b/Editor/RealityToolkit.VisionOS.Editor.asmdef index 9596ec0..d86608f 100644 --- a/Editor/RealityToolkit.VisionOS.Editor.asmdef +++ b/Editor/RealityToolkit.VisionOS.Editor.asmdef @@ -7,7 +7,9 @@ "GUID:13703f41b24bb904cb2305abe6317e3d", "GUID:9753fcbb5b1feaf459f435ac95e51baa", "GUID:b2d046948d6452a4b8485efc9ce0f88c", - "GUID:2a3f0ca4e21332c44bfdce311ea8943e" + "GUID:2a3f0ca4e21332c44bfdce311ea8943e", + "GUID:dc960734dc080426fa6612f1c5fe95f3", + "GUID:4ddd23ea56a3a40f0aa0036d1624a53e" ], "includePlatforms": [ "Editor" @@ -20,4 +22,4 @@ "defineConstraints": [], "versionDefines": [], "noEngineReferences": false -} +} \ No newline at end of file diff --git a/Editor/VisionOSPackageInstaller.cs b/Editor/VisionOSPackageInstaller.cs index 0965dfd..7e102c6 100644 --- a/Editor/VisionOSPackageInstaller.cs +++ b/Editor/VisionOSPackageInstaller.cs @@ -6,16 +6,16 @@ using RealityCollective.Utilities.Editor; using RealityCollective.Utilities.Extensions; using RealityToolkit.Editor; +using RealityToolkit.Editor.Settings; using System.IO; using UnityEditor; -using UnityEngine; namespace RealityToolkit.VisionOS.Editor { [InitializeOnLoad] internal static class VisionOSPackageInstaller { - private static readonly string destinationPath = Application.dataPath + "/RealityToolkit.Generated/VisionOS"; + private static readonly string destinationPath = Path.Combine(RealityToolkitEditorSettings.Instance.AssetImportPath, "VisionOS"); private static readonly string sourcePath = Path.GetFullPath($"{PathFinderUtility.ResolvePath(typeof(VisionOSPackagePathFinder)).ForwardSlashes()}{Path.DirectorySeparatorChar}{"Assets~"}"); static VisionOSPackageInstaller() diff --git a/Runtime/Player/Rigs/VisionOSPlayerRigServiceModule.cs b/Runtime/Player/Rigs/VisionOSPlayerRigServiceModule.cs index bc0b664..19fc5ec 100644 --- a/Runtime/Player/Rigs/VisionOSPlayerRigServiceModule.cs +++ b/Runtime/Player/Rigs/VisionOSPlayerRigServiceModule.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using RealityCollective.ServiceFramework.Attributes; +using RealityCollective.ServiceFramework.Definitions.Platforms; using RealityToolkit.Player; using RealityToolkit.Player.Rigs; using UnityEngine; diff --git a/Runtime/VisionOSPlatform.cs b/Runtime/VisionOSPlatform.cs deleted file mode 100644 index ede6e43..0000000 --- a/Runtime/VisionOSPlatform.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Reality Collective. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using RealityCollective.ServiceFramework.Definitions.Platforms; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.XR; - -namespace RealityToolkit.VisionOS -{ - /// - /// Used by the toolkit to signal that a feature is available on the visionOS platform. - /// - [System.Runtime.InteropServices.Guid("ff382950-9384-41fd-8617-48d0b6573a94")] - public class VisionOSPlatform : BasePlatform - { - private const string xrDisplaySubsystemDescriptorId = "VisionOS-Display"; - private const string xrInputSubsystemDescriptorId = "VisionOS-Input"; - - /// - public override bool IsAvailable - { - get - { - var displaySubsystems = new List(); - SubsystemManager.GetSubsystems(displaySubsystems); - var xrDisplaySubsystemDescriptorFound = false; - - for (var i = 0; i < displaySubsystems.Count; i++) - { - var displaySubsystem = displaySubsystems[i]; - if (displaySubsystem.SubsystemDescriptor.id.Equals(xrDisplaySubsystemDescriptorId) && - displaySubsystem.running) - { - xrDisplaySubsystemDescriptorFound = true; - } - } - - // The XR Display Subsystem is not available / running, - // the platform doesn't seem to be available. - if (!xrDisplaySubsystemDescriptorFound) - { - return false; - } - - var inputSubsystems = new List(); - SubsystemManager.GetSubsystems(inputSubsystems); - var xrInputSubsystemDescriptorFound = false; - - for (var i = 0; i < inputSubsystems.Count; i++) - { - var inputSubsystem = inputSubsystems[i]; - if (inputSubsystem.SubsystemDescriptor.id.Equals(xrInputSubsystemDescriptorId) && - inputSubsystem.running) - { - xrInputSubsystemDescriptorFound = true; - } - } - - // The XR Input Subsystem is not available / running, - // the platform doesn't seem to be available. - if (!xrInputSubsystemDescriptorFound) - { - return false; - } - - // Only if both, Display and Input XR Subsystems are available - // and running, the platform is considered available. - return true; - } - } - -#if UNITY_EDITOR - /// - public override UnityEditor.BuildTarget[] ValidBuildTargets { get; } = - { - UnityEditor.BuildTarget.VisionOS - }; -#endif - } -} diff --git a/Runtime/VisionOSPlatform.cs.meta b/Runtime/VisionOSPlatform.cs.meta deleted file mode 100644 index 142b35e..0000000 --- a/Runtime/VisionOSPlatform.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: dd5f58626b7c65c4785613ce03767f5c -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} - userData: - assetBundleName: - assetBundleVariant: