public static PlayerScore GetByEnemyScore(PlayerScore playerScore) { if (playerScore == playerLeft) return playerRight; else if (playerScore == playerRight) return playerLeft; return null; }
void outputScore(ScoreOutput scoreOutput, PlayerScore score) { scoreOutput.wins.text = score.wins.ToString(); scoreOutput.reflected.text = Mathf.Clamp((int)(((float)score.reflections / (float)GameScore.GetByEnemyScore(score).thrownshurikens) * 100), 0, 100) + "%"; scoreOutput.catched.text = Mathf.Clamp((int)(((float)score.catches / (float)GameScore.GetByEnemyScore(score).thrownshurikens) * 100), 0, 100) + "%"; scoreOutput.itemhit.text = Mathf.Clamp((int)(((float)score.itemhits / (float)GameScore.GetGlobalScore().spawneditems) * 100), 0, 100) + "%"; scoreOutput.forthit.text = Mathf.Clamp((int)(((float)score.forthits / (float)(score.thrownshurikens + score.reflections)) * 100), 0, 100) + "%"; scoreOutput.dealtdamage.text = score.dealtdamage.ToString(); }
public static void Clear() { global = new GloablScore(); playerLeft = new PlayerScore(); playerRight = new PlayerScore(); }