Beispiel #1
0
    private void OnLevelSet(Level level)
    {
        if (IsLevelStarted)
        {
            Log.Error("Cannot start another level (not yet implemented)");
            return;
        }
        IsLevelStarted = true;
        PresentationHelpers.PresentationWorld.GetExistingSystem <TickSimulationSystem>().UnpauseSimulation(LEVEL_NOT_STARTED);

        if (Game.PlayingAsMaster)
        {
            // load simulation scenes
            PresentationHelpers.SubmitInput(new SimCommandLoadScene()
            {
                SceneName = SimManagersScene.SceneName
            });
            foreach (SceneInfo scene in level.SimulationScenes)
            {
                PresentationHelpers.SubmitInput(new SimCommandLoadScene()
                {
                    SceneName = scene.SceneName
                });
            }
        }

        // instantiate presentation
        Game.InstantiateGameplayPresentationSystems();

        // load presentation scenes
        foreach (SceneInfo scene in level.PresentationScenes)
        {
            SceneService.LoadAsync(scene.SceneName);
        }
    }
 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);
     };
 }
Beispiel #3
0
 public override void OnGameAwake()
 {
     base.OnGameAwake();
     _loadPromise             = SceneService.LoadAsync(_escapeMenuScene.SceneName, LoadSceneMode.Additive);
     _loadPromise.OnComplete += OnEscapeMenuSceneLoaded;
 }