Example #1
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);
        }
Example #2
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);
        }
Example #3
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);
        }