示例#1
0
        private void DisplayAbsorberOnInput()
        {
            if (!_mechanismActive)
            {
                return;
            }

            var reflectorActive  = Input.GetMouseButton(0) && _currentReflectionCount > 1;
            var teleporterActive = Input.GetMouseButton(1) && _currentTeleporterCount > 1;
            var mechanismActive  = reflectorActive || teleporterActive;

            if (reflectorActive)
            {
                _mechanismState = MechanismState.Reflect;
            }
            else if (teleporterActive)
            {
                _mechanismState = MechanismState.Teleport;
            }
            else
            {
                _mechanismState = MechanismState.ShutOff;
            }

            _playerAnimator.SetBool(PlayerData.PlayerShooting, mechanismActive);
            reflector.SetActive(reflectorActive);
            teleporter.SetActive(teleporterActive);

            CheckAndTeleportPlayer(teleporterActive);
        }
示例#2
0
        private void Start()
        {
            _playerAnimator  = GetComponent <Animator>();
            _mechanismActive = true;

            reflectorTrigger.onBulletCollided += OnBulletCollided;
            _mechanismState = MechanismState.ShutOff;

            _teleporterPrevState    = false;
            _currentTeleporterCount = maxTeleporterCount;

            _currentReflectionCount = maxReflectionCount;
        }