本文整理汇总了C#中PlayerMovement.powerupsAcquired方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMovement.powerupsAcquired方法的具体用法?C# PlayerMovement.powerupsAcquired怎么用?C# PlayerMovement.powerupsAcquired使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerMovement
的用法示例。
在下文中一共展示了PlayerMovement.powerupsAcquired方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: removePlayer
public void removePlayer(string _player, PlayerMovement _pm)
{
if(mEnd)
return;
Debug.Log("Alive players: " + mPlayersActive.Count);
mPlayersActive.Remove(_player);
Dictionary<string, int> bunnies_killed = CurrentPlayerKeys.Instance.bunnies_killed;
Dictionary<string, float> distance_traveled = CurrentPlayerKeys.Instance.distance_traveled;
Dictionary<string, int> pots_smashed = CurrentPlayerKeys.Instance.pots_smashed;
Dictionary<string, int> powerups_acquired = CurrentPlayerKeys.Instance.powerups_acquired;
Dictionary<string, int> num_jumps = CurrentPlayerKeys.Instance.num_jumps;
if(bunnies_killed.ContainsKey(_player)) {
bunnies_killed[_player] += _pm.bunniesMurdered();
}
else bunnies_killed[_player] = _pm.bunniesMurdered();
if(distance_traveled.ContainsKey(_player)) {
distance_traveled[_player] += _pm.transform.position.x;
}
else distance_traveled[_player] = _pm.transform.position.x;
if(pots_smashed.ContainsKey(_player)) {
pots_smashed[_player] += _pm.potsSmashed();
}
else pots_smashed[_player] = _pm.potsSmashed();
if(powerups_acquired.ContainsKey(_player)) {
powerups_acquired[_player] += _pm.powerupsAcquired();
}
else powerups_acquired[_player] = _pm.powerupsAcquired();
if(num_jumps.ContainsKey(_player)) {
num_jumps[_player] += _pm.numJumps();
}
else num_jumps[_player] = _pm.numJumps();
if (mPlayersActive.Count <= 1){
string winner;
if(mPlayersActive.Count == 0) {
winner = _player;
}
else {
winner = mPlayersActive[0];
GameObject winner_obj = GameObject.Find(winner);
PlayerMovement pm = winner_obj.GetComponent<PlayerMovement>();
if (bunnies_killed.ContainsKey(winner))
{
bunnies_killed[winner] += pm.bunniesMurdered();
}
else bunnies_killed[winner] = pm.bunniesMurdered();
if (distance_traveled.ContainsKey(winner))
{
distance_traveled[winner] += pm.transform.position.x;
}
else distance_traveled[winner] = pm.transform.position.x;
if (pots_smashed.ContainsKey(winner))
{
pots_smashed[winner] += pm.potsSmashed();
}
else pots_smashed[winner] = pm.potsSmashed();
if (powerups_acquired.ContainsKey(winner))
{
powerups_acquired[winner] += pm.powerupsAcquired();
}
else powerups_acquired[winner] = pm.powerupsAcquired();
if (num_jumps.ContainsKey(winner))
{
num_jumps[winner] += pm.numJumps();
}
else num_jumps[winner] = pm.numJumps();
}
Dictionary<string, int> scoreBook = CurrentPlayerKeys.Instance.playerScores;
if(scoreBook.ContainsKey(winner)) {
scoreBook[winner]++;
}
else scoreBook[winner] = 1;
CurrentPlayerKeys.Instance.lastWinner = winner;
LevelSounds.inst.playWinSound(transform.position);
//audio.PlayOneShot(SoundManager.instance.winSound, SoundManager.instance.winVolume);
StartCoroutine(countDown());
mEnd = true;
}
Debug.Log(bunnies_killed[_player]);
Debug.Log(distance_traveled[_player]);
Debug.Log(pots_smashed[_player]);
Debug.Log(powerups_acquired[_player]);
//.........这里部分代码省略.........