public override void Init(GameSceneManager sceneManager) { base.Init(sceneManager); ScoreData = new ScoreData(); LoadHighScroreFromFile(); Dispatcher.AddHandler(EventNames.ADD_SCORE, OnAddScore); Dispatcher.AddHandler(EventNames.SUM_UP_SCORE, OnSumUpScore); }
public override void Init(GameSceneManager sceneManager) { base.Init(sceneManager); Dispatcher.AddHandler(EventNames.PLAYER_WAS_KILLED, OnPlayerWasKilled); Dispatcher.AddHandler(EventNames.PLAYER_LIFES_COUNT_AFTER_DEATH, OnPlayerLifesCountAfterDeath); Invoke(StartNewRoundAction, sceneManager.DesignDataGameSettings.TimeGapOnGameStart); }
public override void Init(GameSceneManager sceneManager) { base.Init(sceneManager); Dispatcher.AddHandler(EventNames.SHOOT_SOUND, OnShoot); Dispatcher.AddHandler(EventNames.RESPAWN_SHIP_SOUND, OnRespawnShip); Dispatcher.AddHandler(EventNames.DESTROY_SHIP_SOUND, OnDestroyShip); Dispatcher.AddHandler(EventNames.DESTROY_ASTEROID_SOUND, OnDestroyAsteroid); }
public override void Init(GameSceneManager sceneManager) { base.Init(sceneManager); _summaryPanel.SetActive(false); Dispatcher.AddHandler(EventNames.UPDATE_SCORE_IN_UI, OnUpdateScoreText); Dispatcher.AddHandler(EventNames.UPDATE_LIFES_IN_UI, OnUpdateLifesText); Dispatcher.AddHandler(EventNames.UPDATE_SCORES_IN_SUMMARY_PANEL, OnUpdateScoresInSummaryPanel); Dispatcher.AddHandler(EventNames.ENABLE_SUMMARY_PANEL, OnEnableSummaryPanel); }
public override void Init(GameSceneManager sceneManager) { base.Init(sceneManager); SetDesignDataSettings(); GetDataAboutCameraSizeFromCamera(); SetSpawnPointPositionOutsideCamera(); this.GetComponent <Rigidbody2D>().angularVelocity = _spawnPointSpeed; Dispatcher.AddHandler(EventNames.START_NEW_ROUND, OnStartNewRound); Dispatcher.AddHandler(EventNames.STOP_SPAWNING_ASTEROIDS, OnStopSpawningAsteroids); }
//============================================================================== #endregion //=================================================================== //============================================================================== public override void Init(GameSceneManager sceneManager) { base.Init(sceneManager); AssignReferences(); AssertReferences(); SetDesignDataSettings(); InitializeModules(); CurrentState = PlayerState.Disabled; #if UNITY_EDITOR Dispatcher.AddHandler(EventNames.UPDATE_PLAYER_DESIGN_DATA, SetDesignDataSettings); #endif }
private void SetBordersScaleAndPosition(GameSceneManager sceneManager) { float cameraOrtographicSize = sceneManager.CameraController.Camera.orthographicSize; float aspectRatio = sceneManager.CameraController.AspectRatio; float xAxisOffset = cameraOrtographicSize * aspectRatio; float yAxisOffset = cameraOrtographicSize; LeftBorder.SetPosition(cameraOrtographicSize, -xAxisOffset); RightBorder.SetPosition(cameraOrtographicSize, xAxisOffset); TopBorder.SetPosition(cameraOrtographicSize, yAxisOffset); BottomBorder.SetPosition(cameraOrtographicSize, -yAxisOffset); LeftBorder.SetScale(cameraOrtographicSize, aspectRatio); RightBorder.SetScale(cameraOrtographicSize, aspectRatio); TopBorder.SetScale(cameraOrtographicSize, aspectRatio); BottomBorder.SetScale(cameraOrtographicSize, aspectRatio); }
public override void Init(GameSceneManager sceneManager) { base.Init(sceneManager); Camera = this.GetComponent <Camera>(); AspectRatio = (float)Screen.width / Screen.height; }
public virtual void Init(GameSceneManager sceneManager) { GameSceneManager = sceneManager; MainManager = MainManager.Instance; Dispatcher = GameSceneManager.Dispatcher; }
public override void Init(GameSceneManager sceneManager) { base.Init(sceneManager); SetDesignDataSettings(); Dispatcher.AddHandler(EventNames.PLAYER_WAS_KILLED, OnPlayerWasKilled); }
public override void Init(GameSceneManager sceneManager) { base.Init(sceneManager); _pool = new Stack <GameObject>(); Dispatcher.AddHandler(SpawnEventName, OnSpawn); }
public override void Init(GameSceneManager sceneManager) { base.Init(sceneManager); InitializeTeleportersToOppositeBorder(); SetBordersScaleAndPosition(sceneManager); }