static IEnumerator StartRoutine(QuickStartSettings settings)
    {
        SimulationWorldSystem.ClearAllSimulationWorlds();

        SceneService.Load(Assets.emptyScene.name, LoadSceneMode.Additive, LocalPhysicsMode.Physics3D);

        yield return(null); // wait for scene load

        PlayerProfileService.Instance.SetPlayerProfile(settings.localProfileId);

        switch (settings.playMode)
        {
        case QuickStartSettings.PlayMode.Local:
            yield return(StartLocal(settings));

            break;

        case QuickStartSettings.PlayMode.OnlineClient:
            yield return(StartClient(settings));

            break;

        case QuickStartSettings.PlayMode.OnlineServer:
            yield return(StartServer(settings));

            break;
        }

        SceneService.UnloadAsync(Assets.emptyScene);
    }
 static void StopRoutine()
 {
     if (s_currentRoutine != null)
     {
         SceneService.UnloadAsync(Assets.emptyScene);
         CoroutineLauncherService.Instance?.StopCoroutine(s_currentRoutine);
     }
 }
 public override void Initialize(Action <ICoreService> onComplete)
 {
     SceneService.LoadAsync(SCENE_NAME, LoadSceneMode.Additive)
     .OnComplete += (ISceneLoadPromise sceneLoadPromise) =>
     {
         foreach (GameObject go in sceneLoadPromise.Scene.GetRootGameObjects())
         {
             DontDestroyOnLoad(go);
         }
         SceneService.UnloadAsync(SCENE_NAME);
         onComplete(this);
     };
 }
 private void UnloadScene()
 {
     SceneService.UnloadAsync(gameObject.scene.name);
 }