Esempio n. 1
0
 private static CameraInput PollCameraInput(PilotActionMap actionMap)
 {
     return(new CameraInput {
         Horizontal = actionMap.PollAxis(WingsuitAction.LookHorizontal),
         Vertical = actionMap.PollAxis(WingsuitAction.LookVertical),
     });
 }
Esempio n. 2
0
    private void Awake()
    {
        var inputMapping = PilotInput.Bindings.DefaultXbox360Mapping.Value;

        _pilotActionMap = PilotInput.ActionMap.Create(
            new ActionMapConfig <WingsuitAction> {
            ControllerId  = new ControllerId.XInput((PlayerIndex)_controllerId),
            InputSettings = InputSettings.Default,
            InputMapping  = inputMapping
        }, _gameClock);

        _pilotPool = new ObjectPool <GameObject>(() => _pilot);

        var container = new DependencyContainer();

        container.AddDependency("eventSystem", _eventSystem);
        container.AddDependency("windManager", _windManager);
        container.AddDependency("actionMap", new Ref <PilotActionMap>(_pilotActionMap));
        container.AddDependency("gameClock", _gameClock);
        container.AddDependency("fixedClock", _fixedClock);

        DependencyInjector.Default.Inject(_pilot, container);

        _originalTransform = _pilot.transform.MakeImmutable();

        _pooledPilot = _pilotPool.Take();
    }
    private void SetActionMap(PilotActionMap actionMap)
    {
        Initialize();

        _currentActionMap = actionMap;
        if (!_isOff)
        {
            _actionMap.V = actionMap;
        }
    }
Esempio n. 4
0
 private static CharacterInput PollWingsuitInput(PilotActionMap actionMap)
 {
     return(new CharacterInput {
         Pitch = actionMap.PollAxis(WingsuitAction.Pitch),
         Roll = actionMap.PollAxis(WingsuitAction.Roll),
         Yaw = actionMap.PollAxis(WingsuitAction.Yaw),
         Cannonball = actionMap.PollAxis(WingsuitAction.Cannonball),
         CloseLeftArm = actionMap.PollAxis(WingsuitAction.CloseLeftArm),
         CloseRightArm = actionMap.PollAxis(WingsuitAction.CloseRightArm)
     });
 }