本文整理汇总了C#中OuyaSDK.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# OuyaSDK.Equals方法的具体用法?C# OuyaSDK.Equals怎么用?C# OuyaSDK.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OuyaSDK
的用法示例。
在下文中一共展示了OuyaSDK.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleButtonEvents
private void HandleButtonEvents(OuyaSDK.OuyaPlayer p, OuyaSDK.KeyEnum b, OuyaSDK.InputAction bs)
{
if (enabled && NGUITools.GetActive(gameObject))
{
// Ignoring P to allow any player to use the menu
if (bs.Equals(OuyaSDK.InputAction.KeyDown))
{
switch (b)
{
case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
OnKey(KeyCode.UpArrow);
break;
case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
OnKey(KeyCode.DownArrow);
break;
case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
OnKey(KeyCode.LeftArrow);
break;
case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
OnKey(KeyCode.RightArrow);
break;
}
}
if (b == activateButton && gameObject == UICamera.selectedObject)
{
SendMessage("OnPress", bs.Equals(OuyaSDK.InputAction.KeyDown), SendMessageOptions.DontRequireReceiver);
}
}
}
示例2: HandleButtonEvent
//Handles Button Events.
private void HandleButtonEvent(OuyaSDK.OuyaPlayer p, OuyaSDK.KeyEnum b, OuyaSDK.InputAction bs)
{
//Debug.Log(string.Format("Player:{0} | Button:{1} | InputAction:{2}", p, b, bs));
m_inputAction = bs;
m_keyEnum = b;
//If this event was not meant for us then do not handle it.
if (!player.Equals(p)) { return; }
//NOTE: This Button event handler only handles events for Player 1, because of the above statement.
#region BUTTONS O - A
//Check O button for down state
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_O) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
UpdateHighlight(RendererButtonO, true, true);
}
else if (b.Equals(OuyaSDK.KeyEnum.BUTTON_O) && bs.Equals(OuyaSDK.InputAction.KeyUp))
{
UpdateHighlight(RendererButtonO, false, true);
}
//Check U button for down state
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_U) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
UpdateHighlight(RendererButtonU, true, true);
}
else if (b.Equals(OuyaSDK.KeyEnum.BUTTON_U) && bs.Equals(OuyaSDK.InputAction.KeyUp))
{
UpdateHighlight(RendererButtonU, false, true);
}
//Check Y button for down state
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_Y) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
UpdateHighlight(RendererButtonY, true, true);
}
else if (b.Equals(OuyaSDK.KeyEnum.BUTTON_Y) && bs.Equals(OuyaSDK.InputAction.KeyUp))
{
UpdateHighlight(RendererButtonY, false, true);
}
//Check A button for down state
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_A) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
UpdateHighlight(RendererButtonA, true, true);
}
else if (b.Equals(OuyaSDK.KeyEnum.BUTTON_A) && bs.Equals(OuyaSDK.InputAction.KeyUp))
{
UpdateHighlight(RendererButtonA, false, true);
}
//Check L3 button for down state
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_L3) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
UpdateHighlight(RendererAxisLeft, true, true);
}
else if (b.Equals(OuyaSDK.KeyEnum.BUTTON_L3) && bs.Equals(OuyaSDK.InputAction.KeyUp))
{
UpdateHighlight(RendererAxisLeft, false, true);
}
//Check R3 button for down state
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_R3) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
UpdateHighlight(RendererAxisRight, true, true);
}
else if (b.Equals(OuyaSDK.KeyEnum.BUTTON_R3) && bs.Equals(OuyaSDK.InputAction.KeyUp))
{
UpdateHighlight(RendererAxisRight, false, true);
}
#endregion
#region Bumpers
//Check LB button for down state
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_LB) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
UpdateHighlight(RendererLB, true, true);
}
else if (b.Equals(OuyaSDK.KeyEnum.BUTTON_LB) && bs.Equals(OuyaSDK.InputAction.KeyUp))
{
UpdateHighlight(RendererLB, false, true);
}
//Check RB button for down state
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_RB) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
UpdateHighlight(RendererRB, true, true);
}
else if (b.Equals(OuyaSDK.KeyEnum.BUTTON_RB) && bs.Equals(OuyaSDK.InputAction.KeyUp))
{
UpdateHighlight(RendererRB, false, true);
}
#endregion
#region triggers
//Check LT button for down state
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_LT) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
//.........这里部分代码省略.........
示例3: HandleButtonEvent
void HandleButtonEvent(OuyaSDK.OuyaPlayer p, OuyaSDK.KeyEnum b, OuyaSDK.InputAction bs)
{
if (!player.Equals(p)) { return; }
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_O) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
this.animation.Play("attack");
Debug.Log("Button O Down Event was triggered on Player" + player);
}
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_O) && bs.Equals(OuyaSDK.InputAction.KeyUp))
{
Debug.Log("Button O Up Event was triggered on Player" + player);
}
//BATTLE STANCE:
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_Y) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
if (!isBattleStance)
{
//Set Battle stance.
this.animation.Play("waitingforbattle");
isBattleStance = true;
}
else
{
if (this.animation.IsPlaying("waitingforbattle"))
{
this.animation.Play("idle");
isBattleStance = false;
}
}
}
//DANCE:
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_U) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
this.animation.Play("dance");
}
//FAKE Death:
if (b.Equals(OuyaSDK.KeyEnum.BUTTON_A) && bs.Equals(OuyaSDK.InputAction.KeyDown))
{
this.animation.Play("die");
}
}