コード例 #1
0
 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);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        //==============================================================================
        #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
        }
コード例 #7
0
        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);
        }
コード例 #8
0
 public override void Init(GameSceneManager sceneManager)
 {
     base.Init(sceneManager);
     Camera      = this.GetComponent <Camera>();
     AspectRatio = (float)Screen.width / Screen.height;
 }
コード例 #9
0
 public virtual void Init(GameSceneManager sceneManager)
 {
     GameSceneManager = sceneManager;
     MainManager      = MainManager.Instance;
     Dispatcher       = GameSceneManager.Dispatcher;
 }
コード例 #10
0
 public override void Init(GameSceneManager sceneManager)
 {
     base.Init(sceneManager);
     SetDesignDataSettings();
     Dispatcher.AddHandler(EventNames.PLAYER_WAS_KILLED, OnPlayerWasKilled);
 }
コード例 #11
0
 public override void Init(GameSceneManager sceneManager)
 {
     base.Init(sceneManager);
     _pool = new Stack <GameObject>();
     Dispatcher.AddHandler(SpawnEventName, OnSpawn);
 }
コード例 #12
0
 public override void Init(GameSceneManager sceneManager)
 {
     base.Init(sceneManager);
     InitializeTeleportersToOppositeBorder();
     SetBordersScaleAndPosition(sceneManager);
 }