private void SetUpStronghold()
 {
     _levelEditingService.SetUpStronghold(_currentCoordinate)
     .SubscribeOn(Scheduler.ThreadPool)
     .ObserveOn(Scheduler.MainThread)
     .Subscribe(
         _ => _inGameMessageService.PublishMessage("Stronghold Created"),
         e => throw e
         );
 }
        public void Clear()
        {
            _disposable?.Dispose();

            Initialize();

            _disposable = SelectEmptyEnvironment()
                          .Concat(gameEnvironmentLoader.GetLoadNonGameObjectRelatedObservable())
                          .SubscribeOn(Scheduler.ThreadPool)
                          .ObserveOn(Scheduler.MainThread)
                          .Concat(ClearGameObjects())
                          .Concat(
                Observable.NextFrame()     //wait till next frame as it is possible that the game objects are not properly destroyed
                .SelectMany(_ => gameEnvironmentLoader.GetGameObjectRelatedLoadObservable())
                )
                          .Last()
                          .Subscribe(
                _ => { Debug.Log("level cleared"); },
                e =>
            {
#if UNITY_EDITOR
                _messageService.PublishMessage(e.ToString());
#else
                throw e;
#endif
            }
                );
        }
Example #3
0
 public void TryUndo()
 {
     if (_commandExecutionService.TryUndo(out var undoCommand))
     {
         undoCommand.SubscribeOn(NoobSchedulers.ThreadPool).ObserveOn(NoobSchedulers.MainThread)
         .Subscribe(_ => _inGameMessageService.PublishMessage("Undo successful"));
     }
 }
Example #4
0
 public void ShowEditorMessage(string message)
 {
     _messageService.PublishMessage(message);
 }