本文整理汇总了C#中InputManager.BindButton方法的典型用法代码示例。如果您正苦于以下问题:C# InputManager.BindButton方法的具体用法?C# InputManager.BindButton怎么用?C# InputManager.BindButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputManager
的用法示例。
在下文中一共展示了InputManager.BindButton方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
private void Start()
{
m_InputManager = InputManager.Instance;
//I need to make a generic BindButton function for controllers
for (int i = 0; i < 4; ++i)
{
m_InputManager.BindButton("ExecuteFunction_" + i, m_KeyCode, InputManager.ButtonState.OnPress);
m_InputManager.BindButton("ExecuteFunction_" + i, i, m_ControllerButtonCode, InputManager.ButtonState.OnPress);
}
}
示例2: InitInput
private void InitInput()
{
print("Starting Input");
m_InputManager = InputManager.Instance;
// initialize button bindings for each button
for (int i = 0; i < m_playerCount; i++)
{
m_InputManager.BindButton("r_p" + i + "A", i, ControllerButtonCode.A, ButtonState.OnPress);
m_InputManager.BindButton("r_p" + i + "B", i, ControllerButtonCode.B, ButtonState.OnPress);
m_InputManager.BindButton("r_p" + i + "X", i, ControllerButtonCode.X, ButtonState.OnPress);
m_InputManager.BindButton("r_p" + i + "Y", i, ControllerButtonCode.Y, ButtonState.OnPress);
m_InputManager.BindButton("r_p" + i + "Left", i, ControllerButtonCode.Left, ButtonState.OnPress);
m_InputManager.BindButton("r_p" + i + "Right", i, ControllerButtonCode.Right, ButtonState.OnPress);
m_InputManager.BindButton("r_p" + i + "Up", i, ControllerButtonCode.Up, ButtonState.OnPress);
m_InputManager.BindButton("r_p" + i + "Down", i, ControllerButtonCode.Down, ButtonState.OnPress);
}
}
示例3: 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);
}