本文整理汇总了C#中InputState.IsKeyReleased方法的典型用法代码示例。如果您正苦于以下问题:C# InputState.IsKeyReleased方法的具体用法?C# InputState.IsKeyReleased怎么用?C# InputState.IsKeyReleased使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputState
的用法示例。
在下文中一共展示了InputState.IsKeyReleased方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdatePlayerActionInput
/// <summary>
/// This is how we hook keyboard/other input.
/// </summary>
/// <param name="input"></param>
/// <param name="allowFull"></param>
/// <returns></returns>
public override bool UpdatePlayerActionInput(InputState input, bool allowFull)
{
// this is a simple, hard coded example to handle input from a player
// we can probably add some kind of modifier key here for doing something else cool
if (input.IsKeyReleased(Keys.OemPlus))
{
bool canAutoTarget = false;
bool canTargetSpace = false;
bool isAutoTarget;
bool isTargetBlocked;
// find something to kill
ITarget targetHere = this._world.Cursor.GetTargetHere(canAutoTarget, canTargetSpace, out isAutoTarget, out isTargetBlocked);
if (null != targetHere)
{
// output some data to the debug log
DebugLog.Write("Terminating target: {0}", targetHere.DisplayName);
// kill it
Damage.ApplyDamage(targetHere, targetHere.Health);
}
}
return base.UpdatePlayerActionInput(input, allowFull);
}