本文整理汇总了C#中InputManager.GetButtonIndex方法的典型用法代码示例。如果您正苦于以下问题:C# InputManager.GetButtonIndex方法的具体用法?C# InputManager.GetButtonIndex怎么用?C# InputManager.GetButtonIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputManager
的用法示例。
在下文中一共展示了InputManager.GetButtonIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InputButtons
// Constructor
public InputButtons(InputManager inputMgr)
{
Action = inputMgr.GetButtonIndex("action");
Block = inputMgr.GetButtonIndex("block");
Jump = inputMgr.GetButtonIndex("jump");
Up = inputMgr.GetButtonIndex("forward");
Down = inputMgr.GetButtonIndex("backward");
Left = inputMgr.GetButtonIndex("left");
Right = inputMgr.GetButtonIndex("right");
PreviousAttunement = inputMgr.GetButtonIndex("prev_attunement");
NextAttunement = inputMgr.GetButtonIndex("next_attunement");
Hover = inputMgr.GetButtonIndex("hover");
ToggleTargetFocus = inputMgr.GetButtonIndex("toggle_target_focus");
TargetMyself = inputMgr.GetButtonIndex("target_myself");
ShowAllEntities = inputMgr.GetButtonIndex("show_all_entities");
Skills = new int[5];
Attunements = new int[4];
Weapons = new int[2];
for(int i = 0; i < Weapons.Length; i++) {
Weapons[i] = inputMgr.GetButtonIndex("weapon_" + (i + 1));
}
for(int i = 0; i < Attunements.Length; i++) {
Attunements[i] = inputMgr.GetButtonIndex("attunement_" + (i + 1));
}
for(int i = 0; i < Skills.Length; i++) {
Skills[i] = inputMgr.GetButtonIndex("skill_" + (i + 1));
}
}