Beispiel #1
0
        public void EnableTacticalCameraTriggers()
        {
            if (AreTacticalCameraTriggersEnabled)
            {
                throw new InvalidOperationException("Tactical camera is already running.");
            }

            AreTacticalCameraTriggersEnabled = true;
            if (_tacticalCameraSettings.UnlimitedZoomEnabled)
            {
                _gameValueService.EnableUnlimitedZoom();
            }
            _gameValueService.DisableFreeCamera();
            _gameValueService.EnableZoom();
            _gameValueService.EnableCollisionZoomAdjustment();
            _gameValueService.EnableAutoCameraAngleAdjustment();
            _gameValueService.EnableCenteringCameraBehindCharacter();
            _gameValueService.SetCameraZoomDistance(0);

            _keyHandler = _tacticalCameraKeyHandlerFactory.CreateTacticalCameraKeyHandler(_gameValueService, _tacticalCameraSettings, _gameProcess);

            _userInputHandler = _userInputHandlerFactory.CreateUserInputHandler
                                (
                _keyHandler,
                _gameValueService
                                );

            _userInputHandler.StartProcessingInputEvents();
        }
Beispiel #2
0
        public void EnableTacticalCamera()
        {
            if (IsTacticalCameraEnabled)
            {
                return;
            }

            _gameValueService.EnableFreeCamera();
            _gameValueService.DisableAutoCameraAngleAdjustment();
            _gameValueService.DisableCollisionZoomAdjustment();
            _gameValueService.DisableZoom();
            _gameValueService.DisableCenteringCameraBehindCharacter();
            _gameValueService.SetCameraZoomDistance(1.66f);
            _gameValueService.SetZCameraPosition(_gameValueService.GetZCameraPosition() + 2);
            IsTacticalCameraEnabled = true;
            OnTacticalCameraStateChanged(true);
        }
        public void DisableTacticalCamera()
        {
            if (!IsTacticalCameraEnabled)
            {
                return;
            }

            float currentZoom = _gameValueService.GetCameraZoomDistance();

            if (currentZoom <= _turnOnTacticalCameraThreshold)
            {
                _gameValueService.SetCameraZoomDistance(_turnOnTacticalCameraThreshold);
            }

            _gameValueService.SetCameraZoomDistance(0);
            _gameValueService.DisableFreeCamera();
            _gameValueService.EnableAutoCameraAngleAdjustment();
            _gameValueService.EnableCollisionZoomAdjustment();
            _gameValueService.EnableCenteringCameraBehindCharacter();
            _gameValueService.EnableZoom();
            IsTacticalCameraEnabled = false;
            OnTacticalCameraStateChanged(false);
        }