Esempio n. 1
0
        public void Activate()
        {
            _isActive = true;
            _time     = Time.time;

            ApplyStartSpeed(GameController.Instance.GameSession.Level);
            SignalsManager.Register(_levelSignal.Name, OnLevelChange);
        }
Esempio n. 2
0
        public override void OnEnter()
        {
            base.OnEnter();

            UpdateLevel(GameController.Instance.GameSession.Level, GameController.Instance.GameSession.Score);

            SignalsManager.Register(_levelSignal.Name, OnLevelChange);
            SignalsManager.Register(_scoreSignal.Name, OnScoreChanged);
        }
Esempio n. 3
0
        protected override void Awake()
        {
            base.Awake();

            _networkManager = GetComponent <NetworkManager>();
            _networkManager.StartMatch(OnMatchCreate, OnMatchList);

            SignalsManager.Register(_hitTopBoundSignal.Name, OnHitBoundsAction);
            SignalsManager.Register(_hitBottomBoundSignal.Name, OnHitBoundsAction);
        }
Esempio n. 4
0
        protected override void Awake()
        {
            base.Awake();

            _topRacket = Instantiate(_racketPrefab, RacketRoot);
            _topRacket.Setup(RacketType.Top);

            _bottomRacket = Instantiate(_racketPrefab, RacketRoot);
            _bottomRacket.Setup(RacketType.Bottom);

            SignalsManager.Register(_hitRacketSignal.Name, OnHitRacketAction);
            SignalsManager.Register(_hitTopBoundSignal.Name, OnHitBoundsAction);
            SignalsManager.Register(_hitBottomBoundSignal.Name, OnHitBoundsAction);
        }
Esempio n. 5
0
        public override void OnEnter()
        {
            base.OnEnter();

            _livesViewController.Subscribe();
            _livesViewController.UpdateLives(GameController.Instance.GameSession.Lives);

            _level.text = string.Format(LocalizationManager.GetString("Level"), GameController.Instance.GameSession.Level);
            _score.text = GameController.Instance.GameSession.Score.ToString();

            UpdateLevelProgress(GameController.Instance.GameSession.Score);

            SignalsManager.Register(_levelSignal.Name, OnLevelChange);
            SignalsManager.Register(_scoreSignal.Name, OnScoreChanged);
        }
Esempio n. 6
0
        public override void OnEnter()
        {
            base.OnEnter();

            _bestScoreShown = false;
            _tutorial.alpha = 0f;

            UpdateScoreValue(0);
            SignalsManager.Register("CurrentScoreChanged", UpdateScoreValue);

            _showTutorialTask = new WaitTask(this, GameController.Instance.Settings.ActivationTime, () =>
            {
                if (InputEventProvider.Instance.PointersCount == 0)
                {
                    ShowTutorial();
                }
            });
            _showTutorialTask.Start();

            InputEventProvider.Instance.PointerDown += OnPointerDown;
            InputEventProvider.Instance.PointerUp   += OnPointerUp;
        }
Esempio n. 7
0
 protected override void Register()
 {
     SignalsManager.Register(Signal.Name, Action.Invoke);
 }
Esempio n. 8
0
 public override void Activate()
 {
     UpdateColor(GameController.Instance.GameSession.Color);
     SignalsManager.Register(_colorSignal.Name, UpdateColor);
 }
Esempio n. 9
0
 protected override void Register()
 {
     SignalsManager.Register(Signal.Name, (UnityAction <float>)Action.Invoke);
 }
Esempio n. 10
0
 private void OnEnable()
 {
     SignalsManager.Register(Signal.Name, Action.Invoke);
 }
Esempio n. 11
0
 private void Awake()
 {
     _activeRows = new LinkedList <Row>();
     SignalsManager.Register(_updateSignal.Name, UpdateGrid);
 }
Esempio n. 12
0
 public void Subscribe()
 {
     SignalsManager.Register(_livesSignal.Name, UpdateLives);
     SignalsManager.Register(_colorSignal.Name, ApplyColor);
 }