本文整理汇总了C#中PlayerID类的典型用法代码示例。如果您正苦于以下问题:C# PlayerID类的具体用法?C# PlayerID怎么用?C# PlayerID使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerID类属于命名空间,在下文中一共展示了PlayerID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getPlayer
public Player getPlayer(PlayerID _id)
{
if (_id == PlayerID.one)
return p1;
else
return p2;
}
示例2: Player
public Player(PlayerID _id)
{
lives = 4;
id = _id;
createLives(id);
state = PlayerState.alive;
emptySprite = (Sprite)DisplayManager.Instance().getDisplayObj(SpriteEnum.box);
if (_id == PlayerID.one)
{
bombSprite = new Sprite(SpriteEnum.Bomb, 0, 0, 50, 50, true, 0,
ImageManager.Instance().getImage(ImageEnum.bluebomb1), false);
missileType = GameObjType.p1missiles;
}
else
{
bombSprite = new Sprite(SpriteEnum.Bomb, 0, 0, 50, 50, true, 0,
ImageManager.Instance().getImage(ImageEnum.greenbomb1), false);
missileType = GameObjType.p2missiles;
}
bombSpriteIndex = 5;
numMissiles = 0;
}
示例3: MoveToNextLevel
public static void MoveToNextLevel(PlayerID playerID)
{
if (LevelProgression != null)
{
LevelProgression(playerID);
}
}
示例4: GetButton
/// <summary>
/// Returns the state of a specified button on a specified controller
/// </summary>
/// <param name="bttnInpt">ID of button to check against</param>
/// <param name="plyrID">ID of corresponding player to check against</param>
/// <returns></returns>
public static bool GetButton(AbstractButtonInput bttnInpt, PlayerID plyrID = PlayerID.FIRST) {
InputForm curInForm = GetCurrentState(plyrID); // Current Input form
if (GetButtonState(curInForm, AbstractToButtonID(bttnInpt)) == buttonState.PRESSED) { return true; }
return false;
}
示例5: IsCharacterAvailable
private bool IsCharacterAvailable(PlayerID pid) {
switch(pid) {
case PlayerID.One:
if (player2Joined && (Mathf.Abs(player2SelectedCharacter%4) == Mathf.Abs(player1SelectedCharacter%4))) return false;
else if (player3Joined && (Mathf.Abs(player3SelectedCharacter%4) == Mathf.Abs(player1SelectedCharacter%4))) return false;
else if (player4Joined && (Mathf.Abs(player4SelectedCharacter%4) == Mathf.Abs(player1SelectedCharacter%4))) return false;
else return true;
break;
case PlayerID.Two:
if (player1Joined && (Mathf.Abs(player1SelectedCharacter%4) == Mathf.Abs(player2SelectedCharacter%4))) return false;
else if (player3Joined && (Mathf.Abs(player3SelectedCharacter%4) == Mathf.Abs(player2SelectedCharacter%4))) return false;
else if (player4Joined && (Mathf.Abs(player4SelectedCharacter%4) == Mathf.Abs(player2SelectedCharacter%4))) return false;
else return true;
break;
case PlayerID.Three:
if (player2Joined && (Mathf.Abs(player2SelectedCharacter%4) == Mathf.Abs(player3SelectedCharacter%4))) return false;
else if (player1Joined && (Mathf.Abs(player1SelectedCharacter%4) == Mathf.Abs(player3SelectedCharacter%4))) return false;
else if (player4Joined && (Mathf.Abs(player4SelectedCharacter%4) == Mathf.Abs(player3SelectedCharacter%4))) return false;
else return true;
break;
case PlayerID.Four:
if (player2Joined && (Mathf.Abs(player2SelectedCharacter%4) == Mathf.Abs(player4SelectedCharacter%4))) return false;
else if (player3Joined && (Mathf.Abs(player3SelectedCharacter%4) == Mathf.Abs(player4SelectedCharacter%4))) return false;
else if (player1Joined && (Mathf.Abs(player1SelectedCharacter%4) == Mathf.Abs(player4SelectedCharacter%4))) return false;
else return true;
break;
}
return false;
}
示例6: Effect
public override void Effect(PlayerID hitPlayer)
{
// If a player was hit
if (hitPlayer != 0)
{
base.Effect(hitPlayer);
spawnedReference.GetComponent<VirusAttack>().UpdatePlayerInfo(fromPlayer, hitPlayer);
}
}
示例7: GetCombo
public static bool GetCombo(string cmbName, PlayerID plyrID) {
Move cachedMove;
if (moveDictonary.TryGetValue(cmbName, out cachedMove)) {
if (CheckCombo(cachedMove, ref lastComboTime[(int)plyrID], ref cachedMove.lastIndex, plyrID)) { return true; }
}
return false;
}
示例8: Effect
public override void Effect(PlayerID hitPlayer)
{
//applies explosive force iff a player was hit
if (hitPlayer != 0)
{
Player.Controller hitPlayerController = Data.GameManager.instance.GetPlayer(hitPlayer);
hitPlayerController.GetComponent<Rigidbody>().AddExplosionForce(HeavyKnockbackForce, transform.position, HeavyKnockbackRadius);
}
}
示例9: InitArrow
/// <summary>
/// Initializes the arrow by adding all the necesary components.
/// </summary>
/// <param name="types">The types of arrow components to be added. Comes from the different tokens the player has collected.</param>
/// <param name="fromPlayer">ID of the player shooting the arrow.</param>
public void InitArrow(int types, PlayerID fromPlayer)
{
// Update the player info
this.fromPlayer = fromPlayer;
// Initializing this arrow
GenerateArrowProperties(types);
// Call the init event for all arrow componenets
if (Init != null) Init();
}
示例10: ModifyHealth
/// <summary>
/// Modifies a player's heath
/// </summary>
/// <param name="delta">The amound to change (should be negative for damage)</param>
/// <param name="id">The player who dealt the damage</param>
public void ModifyHealth(float delta, PlayerID id = PlayerID.None)
{
if(id != PlayerID.None) lastAttacker = id;
if (health > 0)
{
health = Mathf.Clamp((health + delta), 0, MAX_HEALTH);
if (health <= 0) Die();
//controller.InvincibleFrames = Controller.INVINCIBLE_FRAMES;
}
}
示例11: Effect
public override void Effect(PlayerID hitPlayer)
{
//applies knockback force iff a player was hit
if (hitPlayer != 0)
{
Player.Controller hitPlayerController = Data.GameManager.instance.GetPlayer(hitPlayer);
//hitPlayerController.GetComponent<Rigidbody>().AddExplosionForce(HeavyKnockbackForce, transform.position, HeavyKnockbackRadius);
hitPlayerController.GetComponent<Rigidbody>().AddForce(Vector3.Normalize(transform.forward) * DELTA_V, ForceMode.VelocityChange);
}
}
示例12: Effect
public override void Effect(PlayerID hitPlayer)
{
// If the prefab is not null
if (spawnEffect != null)
{
GameObject g = (GameObject)Instantiate(spawnEffect, colInfo.HitPosition, colInfo.HitRotation);
spawnedReference = g;
}
else Debug.Log("Arrow of type: " + type.ToString() + " could not load an effect");
}
示例13: Effect
/// <summary>
/// Override the ArrowProperty effect to add the acid effect to the player that was hit
/// </summary>
/// <param name="hitPlayer">This is the player ID of the player that was hit or 0 if no player was hit</param>
public override void Effect(PlayerID hitPlayer)
{
// If a player was hit
if (hitPlayer != 0)
{
// Add the attack component to the player that was hit and let the effect know who it came from
AcidAttack a = Data.GameManager.instance.AllPlayers.Find(x => x.ID.Equals(hitPlayer)).gameObject.AddComponent<AcidAttack>();
a.UpdatePlayerInfo(fromPlayer, hitPlayer);
}
}
示例14: Effect
public override void Effect(PlayerID hitPlayer)
{
// If a player was hit
if (hitPlayer != 0)
{
Controller sourceController = GameManager.instance.GetPlayer(fromPlayer);
float damage = GetComponent<ArrowController>().Damage;
sourceController.LifeComponent.ModifyHealth(damage);
}
}
示例15: hit
public void hit(PlayerID _id)
{
PlayerManager.Instance().getPlayer(_id).state = PlayerState.dead;
TimeSpan currentTime = Timer.GetCurrentTime();
TimeSpan t_1 = currentTime.Add(new TimeSpan(0, 0, 0, 0, 600));
CallBackData nodeData = new CallBackData(3, TimeSpan.Zero);
nodeData.playerID = _id;
Timer.Add(t_1, nodeData, PlayerManager.Instance().respawn);
}