From ab0914408d61b3b047c9a08ec4c6a111d48e50dd Mon Sep 17 00:00:00 2001 From: SimonDarksideJ Date: Thu, 11 Jan 2024 14:27:19 +0000 Subject: [PATCH 1/2] Migration of CameraService to Player Service --- Editor/DevToolsPackageModulesInstaller.cs | 10 +++++----- Runtime/DiagnosticsService.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Editor/DevToolsPackageModulesInstaller.cs b/Editor/DevToolsPackageModulesInstaller.cs index 16fe952..b16fedb 100644 --- a/Editor/DevToolsPackageModulesInstaller.cs +++ b/Editor/DevToolsPackageModulesInstaller.cs @@ -55,7 +55,7 @@ public bool Install(ServiceConfiguration serviceConfiguration) return false; } - if (!ServiceManager.Instance.TryGetServiceProfile(out var cameraServiceProfile)) + if (!ServiceManager.Instance.TryGetServiceProfile(out var PlayerServiceProfile)) { UnityEngine.Debug.LogWarning($"Could not install {serviceConfiguration.InstancedType.Type.Name}.{nameof(DiagnosticsServiceProfile)} not found."); return false; @@ -65,14 +65,14 @@ public bool Install(ServiceConfiguration serviceConfiguration) var typedServiceConfiguration = new ServiceConfiguration(serviceConfiguration.InstancedType.Type, serviceConfiguration.Name, serviceConfiguration.Priority, serviceConfiguration.RuntimePlatforms, serviceConfiguration.Profile); // Make sure it's not already in the target profile. - if (cameraServiceProfile.ServiceConfigurations.All(sc => sc.InstancedType.Type != serviceConfiguration.InstancedType.Type)) + if (PlayerServiceProfile.ServiceConfigurations.All(sc => sc.InstancedType.Type != serviceConfiguration.InstancedType.Type)) { - cameraServiceProfile.AddConfiguration(typedServiceConfiguration); - UnityEngine.Debug.Log($"Successfully installed the {serviceConfiguration.InstancedType.Type.Name} to {cameraServiceProfile.name}."); + PlayerServiceProfile.AddConfiguration(typedServiceConfiguration); + UnityEngine.Debug.Log($"Successfully installed the {serviceConfiguration.InstancedType.Type.Name} to {PlayerServiceProfile.name}."); } else { - UnityEngine.Debug.Log($"Skipped installing the {serviceConfiguration.InstancedType.Type.Name} to {cameraServiceProfile.name}. Already installed."); + UnityEngine.Debug.Log($"Skipped installing the {serviceConfiguration.InstancedType.Type.Name} to {PlayerServiceProfile.name}. Already installed."); } return true; diff --git a/Runtime/DiagnosticsService.cs b/Runtime/DiagnosticsService.cs index 0d46706..54733df 100644 --- a/Runtime/DiagnosticsService.cs +++ b/Runtime/DiagnosticsService.cs @@ -6,7 +6,7 @@ using RealityCollective.ServiceFramework.Attributes; using RealityCollective.ServiceFramework.Definitions.Platforms; using RealityCollective.ServiceFramework.Services; -using RealityToolkit.CameraService.Interfaces; +using RealityToolkit.PlayerService.Interfaces; using RealityToolkit.DevTools.ConsoleDiagnostics; using RealityToolkit.DevTools.FrameDiagnostics; using RealityToolkit.DevTools.MemoryDiagnostics; @@ -47,7 +47,7 @@ private Transform RigTransform { if (rigTransform == null) { - rigTransform = ServiceManager.Instance.TryGetService(out var cameraSystem) + rigTransform = ServiceManager.Instance.TryGetService(out var cameraSystem) ? cameraSystem.CameraRig.RigTransform : Camera.main.transform.parent; } From ef8fb3b904889475032690e1a696221abe73edd8 Mon Sep 17 00:00:00 2001 From: SimonDarksideJ Date: Thu, 11 Jan 2024 15:15:02 +0000 Subject: [PATCH 2/2] Validations of "Camera" use --- Runtime/DiagnosticsService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/DiagnosticsService.cs b/Runtime/DiagnosticsService.cs index 54733df..38c6cda 100644 --- a/Runtime/DiagnosticsService.cs +++ b/Runtime/DiagnosticsService.cs @@ -47,8 +47,8 @@ private Transform RigTransform { if (rigTransform == null) { - rigTransform = ServiceManager.Instance.TryGetService(out var cameraSystem) - ? cameraSystem.CameraRig.RigTransform + rigTransform = ServiceManager.Instance.TryGetService(out var playerService) + ? playerService.PlayerRig.RigTransform : Camera.main.transform.parent; } return rigTransform;