Пример #1
0
        private void Awake()
        {
            _objectPooler        = FindObjectOfType <ObjectPooler>();
            _gameSoundController = FindObjectOfType <GameSoundController>();

            EquipWeapon();
        }
Пример #2
0
 public IntroState(GameSoundController soundController, HudPanel hudPanel, GameContext gameContext, ShipsFormation shipsFormation,
                   TopPlayersStorage topPlayersStorage, LevelContext levelContext, PlayerShip playerShip)
 {
     _soundController   = soundController;
     _hudPanel          = hudPanel;
     _gameContext       = gameContext;
     _shipsFormation    = shipsFormation;
     _topPlayersStorage = topPlayersStorage;
     _levelContext      = levelContext;
     _playerShip        = playerShip;
 }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Пример #4
0
 public RecordApplyingState(EnterNamePanel panel, TopPlayersStorage scoreStorage, GameContext gameContext, IUserInput userInput,
                            GameSoundController soundController)
 {
     _panel                  = panel;
     _scoreStorage           = scoreStorage;
     _gameContext            = gameContext;
     _userInput              = userInput;
     _soundController        = soundController;
     _initialPanelPosition   = panel.transform.localPosition;
     _panelPositionOffscreen = Screen.height / 2;
 }
Пример #5
0
 //dont destroy this object on new load of scene, if there is already this object destroy new instance
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(gameObject);
 }
Пример #6
0
        public void Initialize(FormationSettings formationSettings, LevelSettings levelSettings, EnemiesSpawner enemiesSpawner,
                               GameSoundController soundController)
        {
            _levelSettings   = levelSettings;
            _enemiesSpawner  = enemiesSpawner;
            _soundController = soundController;

            var maxColumnsCount = levelSettings.EnemiesLines.Max(line => line.EnemiesInLine);

            (_formationCells, _incomingWaves) = BuildFormation(levelSettings.EnemiesLines, maxColumnsCount);
            FormationExpander.AttachTo(gameObject, formationSettings, _formationCells,
                                       levelSettings.EnemiesLines.Count, maxColumnsCount);

            FormationMover.AttachTo(gameObject, formationSettings, levelSettings, levelSettings.EnemiesLines.Count,
                                    maxColumnsCount);
        }
Пример #7
0
    void Start()
    {
        //Load game saves
        GameData.Instance.Load();

        //Setup scripts references
        cameraSystem        = GetComponent <CameraSystemController>();
        keyItemSpawner      = GetComponent <KeyItemSpawner>();
        scoreCounter        = GetComponent <ScoreCounter>();
        gameSoundController = GetComponent <GameSoundController>();
        mVariedGameplay     = GetComponent <VariedGameplayController>();

        Debug.Assert(gameSoundController != null);
        Debug.Assert(mVariedGameplay != null);

        pickupHandler = scoreCounter.HandlePickUp;

        RestartGame();
    }
Пример #8
0
 private void Awake()
 {
     _gameSoundController = FindObjectOfType <GameSoundController>();
 }
Пример #9
0
 // Use this for initialization
 void Start()
 {
     mSoundController = GetComponent <GameSoundController>();
     Debug.Assert(mSoundController != null);
 }