private void Awake() { _objectPooler = FindObjectOfType <ObjectPooler>(); _gameSoundController = FindObjectOfType <GameSoundController>(); EquipWeapon(); }
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); } }
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; }
//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); }
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); }
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(); }
private void Awake() { _gameSoundController = FindObjectOfType <GameSoundController>(); }
// Use this for initialization void Start() { mSoundController = GetComponent <GameSoundController>(); Debug.Assert(mSoundController != null); }