示例#1
0
 void Awake()
 {
     _cancelInput    = InputSource.Key(KeyCode.Escape);
     _candidateInput = InputMap <InputSource, ButtonEvent> .Empty;
     _joystickActivator.ActiveController.Subscribe(controllerId => {
         _candidateInput = InputRebinding
                           .CreateCandidateInputMap(
             controllerId.HasValue ? controllerId.Value.Id : null,
             joystickAxisMappingThreshold,
             mouseAxisMappingThreshold)
                           .Adapt(() => Adapters.ButtonEvents(() => Time.frameCount));
     });
 }