Ejemplo n.º 1
0
        private void Awake()
        {
            _enemyLayerMask         = LayerMask.GetMask("Enemy");
            _enemyAndWorldLayerMask = LayerMask.GetMask("World", "Enemy");

            //Cursor.lockState = CursorLockMode.Confined;
            //Cursor.visible = false;
            UpdateCurrentGunType(0);
            GameController.OnEnemySoulCollected += UpdateCurrentGunType;
            GameController.OnRestartGame        += () =>
            {
                GunTypeFactory.OnRestartGame();
                UpdateCurrentGunType(0);
            };
        }
Ejemplo n.º 2
0
        private void UpdateCurrentGunType(int soulCollectedCount)
        {
            if (soulCollectedCount % 10 != 0)
            {
                return;
            }

            CurrentGunType   = GunTypeFactory.GetNextGunType();
            _cooldownElapsed = 0f;
            _coolingDown     = false;
            var gunUpgradeFlash = Instantiate(GunUpgradeFlash);

            gunUpgradeFlash.GetComponent <Transform>().position = transform.position;
            GameController.NotifyGunChange();
        }