Пример #1
0
        public UniTask Initialize()
        {
            _gameSignals = DIResolver.GetObject <GameSignals>();

            _gameSignals.GameEntityCollisionTriggeredSignal.Listen(HandleGameEntityCollisionTriggered).AddTo(disposables);

            return(UniTask.CompletedTask);
        }
Пример #2
0
        public UniTask Initialize()
        {
            _asteroidGameSettings  = DIResolver.GetObject <AsteroidGameSettings>();
            _gameSignal            = DIResolver.GetObject <GameSignals>();
            _bookKeepingInGameData = DIResolver.GetObject <BookKeepingInGameData>();

            return(UniTask.CompletedTask);
        }
Пример #3
0
        public UniTask Initialize()
        {
            _gameSignals           = DIResolver.GetObject <GameSignals>();
            _asteroidSpawnerSystem = DIResolver.GetObject <AsteroidSpawnerSystem>();
            _asteroidAssetSource   = DIResolver.GetObject <AsteroidGameAssetSource>();

            _gameSignals.AsteroidDespawnedSignal.Listen(HandleAsteroidDespawned).AddTo(disposables);
            return(UniTask.CompletedTask);
        }
Пример #4
0
        public UniTask Initialize()
        {
            _gameSignals = DIResolver.GetObject <GameSignals>();
            _multiplePrefabMemoryPool = DIResolver.GetObject <MultiplePrefabMemoryPool>();

            _gameSignals.GameEntityDespawnedSignal.Listen(HandleGameEntityDespawned).AddToDisposables(disposables);

            return(UniTask.CompletedTask);
        }
        protected override string OnInit()
        {
            string res = base.OnInit();

            _gameSignals           = DIResolver.GetObject <GameSignals>();
            _bookKeepingInGameData = DIResolver.GetObject <BookKeepingInGameData>();

            return(res);
        }
Пример #6
0
        public UniTask Initialize()
        {
            _gameSignals           = DIResolver.GetObject <GameSignals>();
            _bookKeepingInGameData = DIResolver.GetObject <BookKeepingInGameData>();

            _gameSignals.PlayerDespawnedSignal.Listen(HandlePlayerDespawned, PlayerDespawnedPrioritySignal.Priority.DECREASE_PLAYER_LIFE).AddTo(disposables);

            return(UniTask.CompletedTask);
        }
Пример #7
0
        public UniTask Initialize()
        {
            _gameSignals           = DIResolver.GetObject <GameSignals>();
            _bookKeepingInGameData = DIResolver.GetObject <BookKeepingInGameData>();
            _asteroidGameSettings  = DIResolver.GetObject <AsteroidGameSettings>();
            _playerSpawnerSystem   = DIResolver.GetObject <PlayerSpawnerSystem>();

            _gameSignals.PlayerDespawnedSignal.Listen(HandlePlayerDespawned, PlayerDespawnedPrioritySignal.Priority.RESPAWN_PLAYER).AddTo(disposables);

            return(UniTask.CompletedTask);
        }
Пример #8
0
        public UniTask Initialize()
        {
            _asteroidGameSettings     = DIResolver.GetObject <AsteroidGameSettings>();
            _gameSignals              = DIResolver.GetObject <GameSignals>();
            _multiplePrefabMemoryPool = DIResolver.GetObject <MultiplePrefabMemoryPool>();

            _gameSignals.GameStartSignal.Listen(HandleGameStart, GameStartPrioritySignal.PRIORITY_SETUP_SPAWN_ENEMY).AddTo(disposables);
            _gameSignals.GameEntityDespawnedSignal.Listen(HandleGameEntityDespawned).AddToDisposables(disposables);

            return(UniTask.CompletedTask);
        }
Пример #9
0
        public async UniTask Initialize()
        {
            _multiplePrefabMemoryPool = DIResolver.GetObject <MultiplePrefabMemoryPool>();
            _gameSignals           = DIResolver.GetObject <GameSignals>();
            _asteroidGameSettings  = DIResolver.GetObject <AsteroidGameSettings>();
            _bookKeepingInGameData = DIResolver.GetObject <BookKeepingInGameData>();

            _gameSignals.GameStartSignal.Listen(HandleGameStart, GameStartPrioritySignal.PRIORITY_SPAWN_PLAYER).AddToDisposables(disposables);
            _gameSignals.GameEntityDespawnedSignal.Listen(HandleGameEntityDespawned).AddToDisposables(disposables);

            await UniTask.CompletedTask;
        }
Пример #10
0
        public virtual UniTask Initialize()
        {
            _gameSignals = DIResolver.GetObject <GameSignals>();
            _inputSignal = DIResolver.GetObject <InputSignal>();

            _gameSignals.PlayerSpawnedSignal.Listen(HandlePlayerSpawned).AddTo(disposables);
            _gameSignals.PlayerDespawnedSignal.Listen(HandlePlayerDespawned, PlayerDespawnedPrioritySignal.Priority.UNLISTEN_PLAYER_INPUT).AddTo(disposables);
            _gameSignals.PlayerDoHyperSpaceSignal.Listen(HandlePlayerDoHyperSpace).AddTo(disposables);
            _gameSignals.PlayerHyperSpaceFinishedSignal.Listen(HandlePlayerHyperSpaceFinished).AddTo(disposables);

            return(UniTask.CompletedTask);
        }
Пример #11
0
        public UniTask Initialize()
        {
            _gameSignals             = DIResolver.GetObject <GameSignals>();
            _scoreSystem             = DIResolver.GetObject <ScoreSystem>();
            _asteroidScoreDataSource = DIResolver.GetObject <AsteroidScoreDataSourceScriptableObject>();

            _gameSignals.GameStartSignal.Listen(HandleGameStart, GameStartPrioritySignal.PRIORITY_SETUP_ADD_SCORE_SYSTEM).AddTo(disposables);
            _gameSignals.GameOverSignal.Listen(HandleGameOver).AddTo(disposables);
            _gameSignals.AsteroidDespawnedSignal.Listen(HandleAsteroidDespawned).AddTo(disposables);

            return(UniTask.CompletedTask);
        }
Пример #12
0
        public UniTask Initialize()
        {
            _highScoreManager      = DIResolver.GetObject <HighScoreManager>();
            _gameSignals           = DIResolver.GetObject <GameSignals>();
            _bookKeepingInGameData = DIResolver.GetObject <BookKeepingInGameData>();

            _gameSignals.GameOverSignal.Listen(HandleGameOver).AddToDisposables(disposables);

            _bookKeepingInGameData.HighScore.Value = _highScoreManager.GetCurrentHighScore();

            return(UniTask.CompletedTask);
        }
Пример #13
0
 private void Awake()
 {
     if (rb == null)
     {
         rb = GetComponent <Rigidbody2D>();
     }
     if (_healthComponent == null)
     {
         _healthComponent = GetComponent <EntityHealthComponent>();
     }
     _multiplePrefabMemoryPool = DIResolver.GetObject <MultiplePrefabMemoryPool>();
     _gameSignals = DIResolver.GetObject <GameSignals>();
 }
Пример #14
0
        public UniTask Initialize()
        {
            _gameSignals           = DIResolver.GetObject <GameSignals>();
            _asteroidSpawnerSystem = DIResolver.GetObject <AsteroidSpawnerSystem>();
            _asteroidAssetSource   = DIResolver.GetObject <AsteroidGameAssetSource>();
            _bookKeepingInGameData = DIResolver.GetObject <BookKeepingInGameData>();

            _gameSignals.GameStartSignal.Listen(HandleGameStartSignal, GameStartPrioritySignal.PRIORITY_SPAWN_WAVE).AddTo(disposables);
            _gameSignals.AsteroidSpawnedSignal.Listen(HandleAsteroidSpawned).AddTo(disposables);
            _gameSignals.AsteroidDespawnedSignal.Listen(HandleAsteroidDespawned).AddTo(disposables);

            return(UniTask.CompletedTask);
        }
Пример #15
0
        public UniTask Initialize()
        {
            _bookKeepingInGameData = DIResolver.GetObject <BookKeepingInGameData>();
            _gameSignal            = DIResolver.GetObject <GameSignals>();

            _bookKeepingInGameData.PlayerLife.Subscribe(life =>
            {
                if (life == 0)
                {
                    GoToGameOverState();
                }
            }).AddTo(disposables);

            return(UniTask.CompletedTask);
        }
Пример #16
0
        public UniTask Initialize()
        {
            _asteroidGameSettings = DIResolver.GetObject <AsteroidGameSettings>();
            _gameSignals          = DIResolver.GetObject <GameSignals>();

            Camera mainCamera = Camera.main;

            minWorldPos = mainCamera.ViewportToWorldPoint(_asteroidGameSettings.minWrapViewportPosition);
            maxWorldPos = mainCamera.ViewportToWorldPoint(_asteroidGameSettings.maxWrapViewportPosition);

            _gameSignals.PlayerSpawnedSignal.Listen(HandlePlayerSpawned).AddTo(disposables);
            _gameSignals.PlayerDespawnedSignal.Listen(HandlePlayerDespawned, PlayerDespawnedPrioritySignal.Priority.REMOVE_FROM_POSITION_WRAPPER).AddTo(disposables);

            _gameSignals.BulletSpawnedSignal.Listen(HandleBulletSpawned).AddTo(disposables);
            _gameSignals.BulletDespawnedSignal.Listen(HandleBulletDespawned).AddTo(disposables);

            _gameSignals.AsteroidSpawnedSignal.Listen(HandleAsteroidSpawned).AddTo(disposables);
            _gameSignals.AsteroidDespawnedSignal.Listen(HandleAsteroidDespawned).AddTo(disposables);

            return(UniTask.CompletedTask);
        }
Пример #17
0
        public UniTask Initialize()
        {
            _multiplePrefabMemoryPool = DIResolver.GetObject <MultiplePrefabMemoryPool>();
            _asteroidGameSettings     = DIResolver.GetObject <AsteroidGameSettings>();
            _asteroidAssetSource      = DIResolver.GetObject <AsteroidGameAssetSource>();
            _gameSignals = DIResolver.GetObject <GameSignals>();

            Camera mainCamera = Camera.main;

            minWorldPos = mainCamera.ViewportToWorldPoint(Vector2.zero);
            maxWorldPos = mainCamera.ViewportToWorldPoint(Vector2.one);

            minAdditionalWorldPos  = mainCamera.ViewportToWorldPoint(_asteroidGameSettings.minAsteroidSpawnAdditionalViewportPosition);
            minAdditionalWorldPos -= minWorldPos;
            maxAdditionalWorldPos  = mainCamera.ViewportToWorldPoint(_asteroidGameSettings.maxAsteroidSpawnAdditionalViewportPosition);
            maxAdditionalWorldPos -= minWorldPos;

            _gameSignals.GameEntityDespawnedSignal.Listen(HandleGameEntityDespawned).AddTo(disposables);

            return(UniTask.CompletedTask);
        }
        public UniTask Initialize()
        {
            _asteroidGameSettings     = DIResolver.GetObject <AsteroidGameSettings>();
            _asteroidGameAssetSource  = DIResolver.GetObject <AsteroidGameAssetSource>();
            _gameSignals              = DIResolver.GetObject <GameSignals>();
            _enemySaucerSpawnerSystem = DIResolver.GetObject <EnemySaucerSpawnerSystem>();

            _gameSignals.GameStartSignal.Listen(HandleGameStart, GameStartPrioritySignal.PRIORITY_SETUP_SPAWN_ENEMY).AddTo(disposables);
            _gameSignals.GameOverSignal.Listen(HandleGameOver).AddTo(disposables);

            Camera mainCamera = Camera.main;

            minWorldPos = mainCamera.ViewportToWorldPoint(Vector2.zero);
            maxWorldPos = mainCamera.ViewportToWorldPoint(Vector2.one);

            minAdditionalWorldPos  = mainCamera.ViewportToWorldPoint(_asteroidGameSettings.minEnemySpawnAdditionalViewportPosition);
            minAdditionalWorldPos -= minWorldPos;
            maxAdditionalWorldPos  = mainCamera.ViewportToWorldPoint(_asteroidGameSettings.maxEnemySpawnAdditionalViewportPosition);
            maxAdditionalWorldPos -= minWorldPos;

            return(UniTask.CompletedTask);
        }
 private void Awake()
 {
     _gameSignals = DIResolver.GetObject <GameSignals>();
 }