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

Feature/camera to player #11

Merged
merged 2 commits into from
Jan 11, 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
10 changes: 5 additions & 5 deletions Editor/DevToolsPackageModulesInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public bool Install(ServiceConfiguration serviceConfiguration)
return false;
}

if (!ServiceManager.Instance.TryGetServiceProfile<IDiagnosticsService, DiagnosticsServiceProfile>(out var cameraServiceProfile))
if (!ServiceManager.Instance.TryGetServiceProfile<IDiagnosticsService, DiagnosticsServiceProfile>(out var PlayerServiceProfile))
{
UnityEngine.Debug.LogWarning($"Could not install {serviceConfiguration.InstancedType.Type.Name}.{nameof(DiagnosticsServiceProfile)} not found.");
return false;
Expand All @@ -65,14 +65,14 @@ public bool Install(ServiceConfiguration serviceConfiguration)
var typedServiceConfiguration = new ServiceConfiguration<IDiagnosticsServiceModule>(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;
Expand Down
6 changes: 3 additions & 3 deletions Runtime/DiagnosticsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -47,8 +47,8 @@ private Transform RigTransform
{
if (rigTransform == null)
{
rigTransform = ServiceManager.Instance.TryGetService<ICameraService>(out var cameraSystem)
? cameraSystem.CameraRig.RigTransform
rigTransform = ServiceManager.Instance.TryGetService<IPlayerService>(out var playerService)
? playerService.PlayerRig.RigTransform
: Camera.main.transform.parent;
}
return rigTransform;
Expand Down
Loading