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

Add API to check for scene scoped services to initalize #96

Merged
merged 4 commits into from
May 2, 2024

Conversation

FejZa
Copy link
Contributor

@FejZa FejZa commented May 2, 2024

Reality Collective - Service Framework Pull Request

Overview

Adds overrides to the ServiceManager.WaitUntilInitializedAsync API to wait for scene scoped services to initialize.

Usage

// Works as usual and waits for the GLOBAL service manager to initialize.
await ServiceManager.WaitUntilInitializedAsync();

// Waits for the GLOBAL service manager to initialize AND services that are scoped to the game object's scene
await ServiceManager.WaitUntilInitializedAsync(gameObject.scene.name);

// Usage in Awake
private async void Awake()
{
     await ServiceManager.WaitUntilInitializedAsync(gameObject.scene.name);
    // .... services are ready
}

Changes

  • Renamed the ServiceManagerInstance component and inspector to the new standard GlobalServiceManager
  • Fixes: (There is no way to know whether scene services have initialized #95)
  • Fixes Packages\com.realitycollective.service-framework\Runtime\AssemblyInfo.cs(9,28): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]]

Breaking Changes

  • Breaking if someone is using the ServiceManagerInstance class somewhere in code, which should almost never be the case. If yes, the resolution is as simple as updating the name to GlobalServiceManager
  • Breaking for the toolkit due to above reason, will update toolkit accordingly

@FejZa FejZa requested a review from SimonDarksideJ as a code owner May 2, 2024 16:39
@FejZa FejZa requested review from Cangi and SimonDarksideJ and removed request for SimonDarksideJ May 2, 2024 16:39
@FejZa FejZa enabled auto-merge May 2, 2024 16:42
package.json Outdated Show resolved Hide resolved
@SimonDarksideJ
Copy link
Contributor

Did not see an new editor menu option to add the scene service manager?

Copy link
Contributor

@SimonDarksideJ SimonDarksideJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should revisit the need for the assembly info files, as we did remove them from other packages. But later, let's just move on now.

@FejZa FejZa merged commit 1812406 into development May 2, 2024
21 checks passed
@FejZa FejZa deleted the feature/scene-scope-ex branch May 2, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants