Esempio n. 1
0
        private void OnTriggerEnter2D(Collider2D other)
        {
            var coin = other.GetComponent <Coin>();

            if (coin != null)
            {
                GameplayController.IncreaseSoftCurrency();
                coin.Disappear();
            }

            var ammoRefill = other.GetComponent <AmmoRefill>();

            if (ammoRefill != null)
            {
                GameplayController.BonusAmmo();
                ammoRefill.Disappear();
            }

            var jetpack = other.GetComponent <Jetpack>();

            if (jetpack != null)
            {
                jetpack.Disappear();
                GameplayController.JetpackCollected.Invoke();
            }
        }
Esempio n. 2
0
        private void OnTriggerEnter2D(Collider2D other)
        {
            var coin = other.GetComponent <Coin>();

            if (coin != null)
            {
                GameplayController.IncreaseSoftCurrency();
                coin.Disappear();
                return;
            }

            var ammoRefill = other.GetComponent <AmmoRefill>();

            if (ammoRefill != null)
            {
                if (!ammoRefill.Consumed)
                {
                    ammoRefill.Consumed = true;
                    ammoRefill.Disappear();
                    GameplayController.BonusAmmo();
                    return;
                }
            }

            var jetpack = other.GetComponent <Jetpack>();

            if (jetpack != null)
            {
                jetpack.Disappear();
                GameplayController.JetpackCollected.Invoke();
                return;
            }

            var scoreIndicator = other.GetComponent <ScoreIndicatorPresenter>();

            if (scoreIndicator != null)
            {
                scoreIndicator.Highlight();
            }
        }
Esempio n. 3
0
 private void UpdateScore()
 {
     _currentHeight = (int)Math.Max(_currentHeight, _playerPresenter.GetCurrentHeight() - _idleHeightDiff);
     GameplayController.SetCurrentScore(_currentHeight);
 }