/// <summary> /// On press event process. /// </summary> /// <param name="eEventType">Input event type.</param> /// <param name="fRawValue">Raw value of input.</param> /// <returns>Get input type of this input event.</returns> public virtual GetInputType OnPressInput(InputEventType eEventType, float fRawValue) { if (previousGetType == null) { previousGetType = new Dictionary <InputEventType, GetInputType>(); } if (!previousGetType.ContainsKey(eEventType)) { previousGetType.Add(eEventType, GetInputType.None); } var eGetType = previousGetType[eEventType]; eGetType = InputUtility.ConvertRawValueToGetType(eGetType, fRawValue); RunEventInput(eEventType, eGetType); SetHoldingInputData(eEventType, eGetType); previousGetType[eEventType] = eGetType; return(eGetType); }
/// <summary> /// On press event process. /// </summary> /// <param name="eButtonType">Input event type.</param> /// <param name="bRawValue">Raw value of input.</param> /// <returns>Get input type of this input event.</returns> protected virtual GetInputType OnPressInput(InputButtonType eButtonType, bool bRawValue) { if (previousGetType == null) { previousGetType = new Dictionary <InputButtonType, GetInputType>(); } if (!previousGetType.ContainsKey(eButtonType)) { previousGetType.Add(eButtonType, GetInputType.None); } var eGetType = previousGetType[eButtonType]; eGetType = InputUtility.ConvertRawValueToGetType(eGetType, bRawValue); RunEventInput(eButtonType, eGetType); SetHoldingInputData(eButtonType, eGetType); previousGetType[eButtonType] = eGetType; return(eGetType); }
public void PressButton(InputAction.CallbackContext hContext) { m_ePreviousInput = InputUtility.ConvertRawValueToGetType(m_ePreviousInput, hContext.ReadValueAsButton()); ProcessRunEvent(); }