Пример #1
0
 /// <summary>
 /// Register event for update Views
 /// </summary>
 private void RegisterEvent()
 {
     EventHub.Bind <EventUpdateScore>(OnScoreUpdate);
     EventHub.Bind <EventGameTimeUpdate>(OnGameTimeUpdate);
     EventHub.Bind <EventEndGame>(OnEndGame);
     EventHub.Bind <EventCharacterPassLayer>(ShowFishesEscapeEffect);
     EventHub.Bind <EventPedestalLayerDestroy>(ShowPedestalLayerDestroyEffect);
     EventHub.Bind <EventGetBonusTime>(ShowBonusTimeEffect);
     EventHub.Bind <EventRevive>(OnRevive);
 }
Пример #2
0
        void Awake()
        {
            EventHub.Bind <EventStartGame>(OnStartGame);
            EventHub.Bind <EventRevive>(OnRevive);

            _scoreCaculator = new SimpleScoreCalculator(_scoreSetting);
            _scoreCaculator.OnScoreUpdate += OnScoreUpdate;


            _roundTime = _gameSetting.roundDuration;
            _gameState = GameState.Waiting;

            _platform.Setup(_gameSetting);
            _platform.OnCharacterPassedThoughPedestalLayer += OnCharacterPassThoughLayer;

            _cameraFollower.Setup(_gameSetting);

            _character.Setup(_gameSetting);
            _character.OnCollideWithPedestal += OnCharacterCollideWithPedestal;
            _character.OnStuckInPedestal     += OnCharacterStuckInPedestal;
        }