本文整理汇总了C#中InputManager.BindAxis方法的典型用法代码示例。如果您正苦于以下问题:C# InputManager.BindAxis方法的具体用法?C# InputManager.BindAxis怎么用?C# InputManager.BindAxis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputManager
的用法示例。
在下文中一共展示了InputManager.BindAxis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeControls
private void InitializeControls()
{
m_InputManager = InputManager.Instance;
//Movement
//PC couldn't handle 4 controllers (super lame, no time)
if (m_PlayerID == 2)
{
m_InputManager.BindAxis("HorizontalAxis_" + m_PlayerID, KeyCode.D, KeyCode.A);
m_InputManager.BindAxis("VerticalAxis_" + m_PlayerID, KeyCode.W, KeyCode.S);
m_InputManager.BindButton("Action_" + m_PlayerID, KeyCode.LeftControl, InputManager.ButtonState.OnPress);
}
if (m_PlayerID == 3)
{
m_InputManager.BindAxis("HorizontalAxis_" + m_PlayerID, KeyCode.RightArrow, KeyCode.LeftArrow);
m_InputManager.BindAxis("VerticalAxis_" + m_PlayerID, KeyCode.UpArrow, KeyCode.DownArrow);
m_InputManager.BindButton("Action_" + m_PlayerID, KeyCode.RightControl, InputManager.ButtonState.OnPress);
}
m_InputManager.BindAxis("HorizontalAxis_" + m_PlayerID, m_PlayerID, ControllerButtonCode.Right, ControllerButtonCode.Left);
m_InputManager.BindAxis("HorizontalAxis_" + m_PlayerID, m_PlayerID, ControllerAxisCode.LeftStickX);
m_InputManager.BindAxis("VerticalAxis_" + m_PlayerID, m_PlayerID, ControllerButtonCode.Up, ControllerButtonCode.Down);
m_InputManager.BindAxis("VerticalAxis_" + m_PlayerID, m_PlayerID, ControllerAxisCode.LeftStickY);
//Action
m_InputManager.BindButton("Action_" + m_PlayerID, m_PlayerID, ControllerButtonCode.A, InputManager.ButtonState.OnPress);
}