bool CheckInput(KeyCode[] keys, InputAction action) { foreach (KeyCode key in keys) { if (Input.GetKeyDown(key) && action != null) { activeControlType = GetInputType(key); action(1); return(true); } if (Input.GetKeyUp(key) && action != null) { activeControlType = GetInputType(key); action(0); return(true); } } return(false); }
public float GetInput(Axis[] axes) { float value = 0; foreach (Axis axis in axes) { float axisValue = Input.GetAxisRaw(axis.ToString()); if (Mathf.Abs(axisValue) >= 1) { activeControlType = GetInputType(axis); return(axisValue); } if (Mathf.Abs(axisValue) > Mathf.Abs(value)) { value = axisValue; activeControlType = GetInputType(axis); } } return(value); }