예제 #1
0
 internal InputControllerAxis(string a_eventKeyName,
                              InputControllerAxisBinding a_binding,
                              bool a_isInverted = false,
                              float a_deadZone  = 0.05f) : base(a_eventKeyName)
 {
     _binding   = a_binding;
     isInverted = a_isInverted;
     deadZone   = Mathf.Clamp01(a_deadZone);
 }
	internal InputControllerThrottleAxis(string a_eventKeyName, 
			                             InputControllerAxisBinding a_binding,
			                             bool a_isInverted = false,
	                                     float a_deadZone = 0.05f) : base(a_eventKeyName, a_binding, a_isInverted, a_deadZone)
	{
		binding = a_binding;
		isInverted = a_isInverted;
		deadZone = Mathf.Clamp01(a_deadZone);
	}
	internal void OnInputDetected(FFEventParameter args)
	{
		FFEngine.Events.UnregisterForEvent("InputAxisDetected", OnInputDetected);
		isRegistered = false;
		
		binding = args.data as InputControllerAxisBinding;
		
		_inputAxis.binding = binding;
		
		UpdateDisplay();
	}
예제 #4
0
    internal void OnInputDetected(FFEventParameter args)
    {
        FFEngine.Events.UnregisterForEvent("InputAxisDetected", OnInputDetected);
        isRegistered = false;

        if (args != null)
        {
            binding = args.data as InputControllerAxisBinding;
            _inputAxis.UpdateBinding(binding);
        }

        UpdateDisplay();
    }
예제 #5
0
    internal void DoUpdate()
    {
        foreach (AInputEvent each in keys.Values)
        {
            each.DoUpdate();
        }
        foreach (AInputAxis each in axis.Values)
        {
            each.DoUpdate();
        }

        if (_isPollingKey)
        {
            InputKeyBinding binding = InputKeyBinding.Current;
            if (binding != null)
            {
                FFEventParameter args = new FFEventParameter();
                args.data = binding;
                FFEngine.Events.FireEvent("InputKeyDetected", args);
                _isPollingKey = false;
            }
        }

        if (_isPollingAxis)
        {
            if (InputKeyBinding.IsEscapePressed())
            {
                FFEngine.Events.FireEvent("InputAxisDetected", null);
            }
            else
            {
                InputControllerAxisBinding binding = InputControllerAxisBinding.Current;
                if (binding != null)
                {
                    FFEventParameter args = new FFEventParameter();
                    args.data = binding;
                    FFEngine.Events.FireEvent("InputAxisDetected", args);
                    _isPollingAxis = false;
                }
            }
        }
    }
예제 #6
0
 internal void UpdateBinding(InputControllerAxisBinding a_newBinding)
 {
     _binding = a_newBinding;
 }
예제 #7
0
 internal InputControllerAxis(EInputAxisKey a_eventKey,
                              InputControllerAxisBinding a_binding,
                              bool a_isInverted = false,
                              float a_deadZone  = 0.05f) : this(a_eventKey.ToString(), a_binding, a_isInverted, a_deadZone)
 {
 }
	internal InputControllerThrottleAxis(EInputAxisKey a_eventKey, 
	                                     InputControllerAxisBinding a_binding,
	                                     bool a_isInverted = false,
	                                     float a_deadZone = 0.05f) : this(a_eventKey.ToString(), a_binding, a_isInverted, a_deadZone)
	{
	}