public void Test() { if (m_PlayerInput == null) { return; } for (int index = 0; index < m_Buttons.Count; ++index) { string button = m_Buttons[index]; if (button != "") { bool buttonPressed = m_PlayerInput.GetButtonDown(button); if (buttonPressed) { Debug.Log("[" + m_PlayerName + "] " + button); } } } for (int index = 0; index < m_Axes.Count; ++index) { string axis = m_Axes[index]; if (axis != "") { float axisValue = m_PlayerInput.GetAxis(axis); if (axisValue != 0f) { Debug.Log("[" + m_PlayerName + "] " + axis + ": " + axisValue); } } } }
// tnInputFiller's INTERFACE public override void Fill(float i_FrameTime, tnInputData i_Data) { if (m_PlayerInput == null) { return; } float horizontalAxisRaw = m_PlayerInput.GetAxis("MoveHorizontal"); float verticalAxisRaw = m_PlayerInput.GetAxis("MoveVertical"); m_HorizontalFilter.Step(horizontalAxisRaw, i_FrameTime); m_VerticalFilter.Step(verticalAxisRaw, i_FrameTime); i_Data.SetAxis(InputActions.s_HorizontalAxis, m_HorizontalFilter.position); i_Data.SetAxis(InputActions.s_VerticalAxis, m_VerticalFilter.position); i_Data.SetButton(InputActions.s_ShotButton, m_PlayerInput.GetButton("Shot")); i_Data.SetButton(InputActions.s_PassButton, m_PlayerInput.GetButton("Pass")); i_Data.SetButton(InputActions.s_AttractButton, m_PlayerInput.GetButton("Attract")); i_Data.SetButton(InputActions.s_TauntButton, m_PlayerInput.GetButton("Taunt")); }