예제 #1
0
        public override void InitializeLevelSelectScreen(LevelSelectScreenViewModel viewModel)
        {
            base.InitializeLevelSelectScreen(viewModel);

            /*
             * Add available levels to the LevelSelectScreen viewmodel
             */
            foreach (var levelDescriptor in LevelManagementService.Levels)
            {
                viewModel.AvailableLevels.Add(levelDescriptor);
            }
        }
        public override void InitializeLevelSelectScreen(LevelSelectScreenViewModel viewModel)
        {
            base.InitializeLevelSelectScreen(viewModel);

            /*
             * Add available levels to the LevelSelectScreen viewmodel
             */
            foreach (var levelDescriptor in LevelManagementService.Levels)
            {
                viewModel.AvailableLevels.Add(levelDescriptor);
            }
        }
        public override void SelectLevel(LevelSelectScreenViewModel viewModel, LevelDescriptor arg)
        {
            base.SelectLevel(viewModel, arg);

            // This can be extracted into a service to load levels from other places
            // without duplicated code. Also external service could handle rules,
            // under which certain level can/cannot be loaded

            if (arg.IsLocked) return; //Level is locked, do not switch scenes

            Publish(new UnloadSceneCommand()
            {
                SceneName = "MainMenuScene" // Unload  main menu scene
            });

            Publish(new LoadSceneCommand()
            {
                SceneName = arg.LevelScene // Load level scene
            });
        }
예제 #4
0
        public override void SelectLevel(LevelSelectScreenViewModel viewModel, LevelDescriptor arg)
        {
            base.SelectLevel(viewModel, arg);

            // This can be extracted into a service to load levels from other places
            // without duplicated code. Also external service could handle rules,
            // under which certain level can/cannot be loaded

            if (arg.IsLocked)
            {
                return;               //Level is locked, do not switch scenes
            }
            Publish(new UnloadSceneCommand()
            {
                SceneName = "MainMenuScene" // Unload  main menu scene
            });

            Publish(new LoadSceneCommand()
            {
                SceneName = arg.LevelScene // Load level scene
            });
        }
예제 #5
0
 public virtual void SelectLevel(LevelSelectScreenViewModel viewModel, LevelDescriptor arg)
 {
 }
예제 #6
0
 public virtual void InitializeLevelSelectScreen(LevelSelectScreenViewModel viewModel)
 {
     // This is called when a LevelSelectScreenViewModel is created
     viewModel.SelectLevel.Action = this.SelectLevelHandler;
     LevelSelectScreenViewModelManager.Add(viewModel);
 }
예제 #7
0
 public virtual void SelectLevel(LevelSelectScreenViewModel viewModel, LevelDescriptor arg)
 {
 }
예제 #8
0
 public virtual void InitializeLevelSelectScreen(LevelSelectScreenViewModel viewModel)
 {
     // This is called when a LevelSelectScreenViewModel is created
     viewModel.SelectLevel.Action = this.SelectLevelHandler;
     LevelSelectScreenViewModelManager.Add(viewModel);
 }