本文整理汇总了C#中InputAction.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# InputAction.ToString方法的具体用法?C# InputAction.ToString怎么用?C# InputAction.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputAction
的用法示例。
在下文中一共展示了InputAction.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsOldActionPress
/// <summary>
/// Determines if an input action was pressed in the last frame but not
/// the current.
/// </summary>
/// <param name="action">The action to check.</param>
/// <returns>True if this is an old action, false if otherwise.</returns>
public static bool IsOldActionPress(InputAction action)
{
if (!inputBindings.ContainsKey(action))
{
throw new ArgumentException(string.Format("InputManager.IsOldActionPress(InputAction): The game settings file does not define an action named {0}.", action.ToString()), "action");
}
InputObject inputObject = inputBindings[action];
return inputObject.IsDown(InputManager.LastKeyboardState, InputManager.LastMouseState) && inputObject.IsUp(InputManager.CurrentKeyboardState, InputManager.CurrentMouseState);
}
示例2: AppendInputActions
private void AppendInputActions(InputAction ia)
{
SpriteFont sf = RM.Font(Font.DefaultFont);
actions.Add(ia);
labels.Add(new MenuOption(ia.ToString(), sf));
List<Button> buttonList = RM.GetButtons(ia);
if (buttonList.Count > 0)
{
op1.Add(new MenuOption(buttonList[0].ToString(), sf));
}
else
{
op1.Add(new MenuOption("<EMPTY>", sf));
}
if (buttonList.Count > 1)
{
op2.Add(new MenuOption(buttonList[1].ToString(), sf ));
}
else
{
op2.Add(new MenuOption("<EMPTY>", sf));
}
if (buttonList.Count > 2)
{
op3.Add(new MenuOption(buttonList[2].ToString(), sf));
}
else
{
op3.Add(new MenuOption("<EMPTY>", sf));
}
}