Example #1
0
        public UniTask Initialize()
        {
            _asteroidGameSettings  = DIResolver.GetObject <AsteroidGameSettings>();
            _gameSignal            = DIResolver.GetObject <GameSignals>();
            _bookKeepingInGameData = DIResolver.GetObject <BookKeepingInGameData>();

            return(UniTask.CompletedTask);
        }
Example #2
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);
        }
Example #3
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);
        }
Example #4
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;
        }
        public UniTask Initialize()
        {
            _bookKeepingInGameData = DIResolver.GetObject <BookKeepingInGameData>();
            _asteroidGameSettings  = DIResolver.GetObject <AsteroidGameSettings>();

            _bookKeepingInGameData.Score.Subscribe(x =>
            {
                EvaluateScore(x);
            }).AddTo(disposables);

            return(UniTask.CompletedTask);
        }
Example #6
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);
        }
Example #7
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);
        }