本文整理汇总了C#中PlayerIndex.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerIndex.Equals方法的具体用法?C# PlayerIndex.Equals怎么用?C# PlayerIndex.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerIndex
的用法示例。
在下文中一共展示了PlayerIndex.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LastGamePadState
public static GamePadState LastGamePadState(PlayerIndex playerIndex)
{
if (playerIndex.Equals(PlayerIndex.One))
return LastP1GamePadState;
else
return LastP2GamePadState;
}
示例2: DbzPlayer
// constructor
public DbzPlayer(SpriteSheet spriteSheet, Vector2 position,
CollisionOffset collisionOffset, Vector2 speed, Vector2 friction, SoundEffect sound1, SoundEffect sound2, Point frameSize, PlayerIndex playerIndex)
: base(spriteSheet, position, collisionOffset, speed, friction)
{
dbzPlayerNum = playerIndex;
if (playerIndex.Equals(PlayerIndex.Two))
{
base.position.X = 800;
effects = SpriteEffects.FlipHorizontally;
dbzPlayerKeys.Add(Keys.I);
dbzPlayerKeys.Add(Keys.K);
dbzPlayerKeys.Add(Keys.J);
dbzPlayerKeys.Add(Keys.L);
dbzPlayerKeys.Add(Keys.N);
dbzPlayerKeys.Add(Keys.O);
dbzPlayerKeys.Add(Keys.U);
}
else
{
base.position.X = 200;
dbzPlayerKeys.Add(Keys.W);
dbzPlayerKeys.Add(Keys.S);
dbzPlayerKeys.Add(Keys.A);
dbzPlayerKeys.Add(Keys.D);
dbzPlayerKeys.Add(Keys.Space);
dbzPlayerKeys.Add(Keys.E);
dbzPlayerKeys.Add(Keys.Q);
}
dbzFrameSize = frameSize;
chargeSound = sound1;
ssLoop = sound2;
chargeSoundInstance = chargeSound.CreateInstance();
ssLoopInstance = ssLoop.CreateInstance();
ssLoopInstance.IsLooped = true;
}