public override IObservable <Unit> Show(TModel model)
        {
            m_showDialogSignal.Type = GetType();
            m_signalBus.TryFire(m_showDialogSignal);

            return(base.Show(model));
        }
Ejemplo n.º 2
0
 public void OnStateEnter()
 {
     signalBus.TryFire(new ResetSignal());
     signalBus.TryFire(new StateChangeSignal()
     {
         newGameState = GetStatesType()
     });
     pathService.DestroyPath();
     pathService.DrawGraph(Graph);
     service.ChangeToPlayerState();
 }
Ejemplo n.º 3
0
        //dead trigger
        async private void PlayerDead()
        {
            isPlayerDead = true;
            playerNodeID = 0;
            //await new WaitForSeconds(.75f);
            signalBus.TryFire(new SignalPlayOneShot()
            {
                soundName = SoundName.playerDeath
            });
            await playerController.PlayAnimation(PlayerStates.DEAD);

            gameService.ChangeToGameOverState();
        }
Ejemplo n.º 4
0
        public void Initialize()
        {
            _gameDeck = Deck.CreateFullDeck();

            OkeyTile    = _gameDeck.GetRandom();
            CurrentHand = CreateHand();

            _currentHandView = _handPool.Spawn();
            _currentHandView.transform.SetParent(_container);
            _currentHandView.Setup(CurrentHand);
            _currentHandView.PlayDistributeAnimation();

            _signalBus.TryFire(new BoardCreatedSignal(OkeyTile));
        }
Ejemplo n.º 5
0
 public void OnStateEnter()
 {
     signalBus.TryFire(new StateChangeSignal()
     {
         newGameState = GetStatesType()
     });
 }
Ejemplo n.º 6
0
        async private void KillEnemy(IEnemyController controllerToKill)
        {
            if (controllerToKill.GetEnemyType() == EnemyType.DOGS)
            {
                starService.DogsKilled();
            }

            await controllerToKill.PlayAnimation(EnemyStates.DEATH);

            enemyList.Remove(controllerToKill);
            controllerToKill.Reset();
            signalBus.TryFire(new EnemyDeathSignal()
            {
                nodeID = controllerToKill.GetCurrentNodeID()
            });
        }
Ejemplo n.º 7
0
 async public Task MoveToLocation(Vector3 _location)
 {
     signalBus.TryFire(new SignalPlayOneShot()
     {
         soundName = SoundName.playerMove
     });
     await currentPlayerView.MoveToLocation(_location);
 }
Ejemplo n.º 8
0
        public override void Initialize()
        {
            SignalBus.Subscribe <AddMovieToGridSignal>(EnqueueSignal);
            SignalBus.Subscribe <RemoveMovieFromGridSignal>(EnqueueSignal);
            SignalBus.Subscribe <ClearGridSignal>(ClearGrid);
            SignalBus.Subscribe <LoadMoviesSignal>((signal) => LoadGrid(signal.Movies));

            SignalBus.TryFire <GridInitSignal>();
        }
Ejemplo n.º 9
0
        public async void OnStateEnter()
        {
            signalBus.TryFire(new StateChangeSignal()
            {
                newGameState = GetStatesType()
            });
            await Task.Delay(TimeSpan.FromSeconds(2));

            service.ChangeToLoadLevelState();
        }
Ejemplo n.º 10
0
        private void OnMovieRemove(MovieDataModel model)
        {
            if (_reactiveDisposible.ContainsKey(model))
            {
                _reactiveDisposible[model].Dispose();
                _reactiveDisposible.Remove(model);
            }

            SignalBus.TryFire(new RemoveMovieFromGridSignal(model));
        }
Ejemplo n.º 11
0
        private void StartGame()
        {
            _sceneManager.LoadSceneAsync(SceneNames.Game, () =>
            {
                _sceneManager.SetActiveScene(SceneNames.Game);

                CoroutineManager.DoAfterFixedUpdate(() =>
                {
                    _signalBus.TryFire <GameStartedSignal>();
                });
            });
        }
Ejemplo n.º 12
0
        public void OnStateEnter()
        {
            List <StarData> stars = pathService.GetStarsForLevel();

            for (int i = 0; i < stars.Count; i++)
            {
                saveService.SaveStarTypeForLevel(currentLevel, stars[i].type, starService.CheckForStar(stars[i].type));
            }
            service.IncrimentMaxLevel();
            signalBus.TryFire(new StateChangeSignal()
            {
                newGameState = GetStatesType()
            });
        }
Ejemplo n.º 13
0
        public ProjectileController(ProjectileService projectileService, float force, Vector2 direction, Vector2 spawnPos, SignalBus signalBus, bool isPlayer)
        {
            _isPlayer          = isPlayer;
            _projectileService = projectileService;
            GameObject projectile = GameObject.Instantiate(GetProjectileView().gameObject);

            projectile.transform.position = spawnPos;
            _projectileView = projectile.GetComponent <ProjectileView>();
            _projectileView.SetController(this);
            _projectileView.Shoot(force, direction);
            signalBus.TryFire(new SignalSpawnProjectile()
            {
                projectileInfo = InitializeProjectileInfo()
            });
        }
        public WeaponFireController(WeaponService weaponService, float force
                                    , Vector2 direction, Vector2 spawnPos, SignalBus signalBus, bool localPlayer)
        {
            SetWeaponType();
            this.LocalPlayer   = localPlayer;
            this.weaponService = weaponService;
            GameObject weapon = GameObject.Instantiate <GameObject>(GetWeaponView().gameObject);

            weapon.transform.position = spawnPos;
            weaponView = weapon.GetComponent <WeaponFireView>();
            weaponView.SetController(this);
            weaponView.Shoot(force, direction);
            signalBus.TryFire(new SignalSpawnWeapon()
            {
                weaponObject = weapon
            });
        }
Ejemplo n.º 15
0
        public static Promise <IPopupResult> ShowPopup(SignalBus signalBus, IPopupConfig popupConfig)
        {
            try
            {
                OpenPopupSignal openPopupParams = new OpenPopupSignal
                {
                    OnPopupComplete = new Promise <IPopupResult>(),
                    PopupConfig     = popupConfig
                };

                signalBus.TryFire(openPopupParams);

                return(openPopupParams.OnPopupComplete);
            }
            catch (Exception e)
            {
                Debug.LogError(e);
                throw;
            }
        }
Ejemplo n.º 16
0
 /// <summary>
 /// Действия при смерти
 /// </summary>
 protected override void OnDead()
 {
     base.OnDead();
     _signalBus.TryFire <OnPlayerDead>();
     Destroy(gameObject);
 }
Ejemplo n.º 17
0
 public override void Show(TModel model)
 {
     base.Show(model);
     m_showDialogSignal.Type = GetType();
     m_signalBus.TryFire(m_showDialogSignal);
 }
Ejemplo n.º 18
0
 private void StartGame()
 {
     _sceneController.LoadSceneAsync(SceneNames.Game);
     _signalBus.TryFire(new GameStartedSignal());
 }
Ejemplo n.º 19
0
 public void AddEntity(IUnit entity)
 {
     entities.Add(entity.GetHashCode(), entity);
     signalBus.TryFire(new UnitBornSignal(entity));
 }