//勝利プレイヤー判定と点数格納 void Init() { for (int i = 0; i < 6; i++) { Rank[i] = 0; BattlePoint[i] = CManager.GetPlayerCost(i + 1).critical + CManager.GetPlayerCost(i + 1).crush; Debug.Log("Battle " + BattlePoint[i]); } for (int i = 0; i < 6; i++) { for (int j = i + 1; j < 6; ++j) { if (BattlePoint[i] <= BattlePoint[j]) { Rank[i]++; //順位の格納 } } } PointColorSet(); RankSet(); PointSet(); }
//勝利プレイヤー判定と点数格納 void Init() { int max = 0; for (int i = 0; i < 6; i++) { ArtisticPoint[i] = CManager.GetPlayerCost(i + 1).art; BattlePoint[i] = CManager.GetPlayerCost(i + 1).critical + CManager.GetPlayerCost(i + 1).crush; TotalPoint[i] = ArtisticPoint[i] + BattlePoint[i]; Debug.Log("芸術 " + ArtisticPoint[i]); Debug.Log("Battle " + BattlePoint[i]); Debug.Log("合計 " + TotalPoint[i]); //TotalPoint[i] = ArtisticPoint[i] + BattlePoint[i]; //1位のプレイヤー判定 if (TotalPoint[i] >= max) { max = TotalPoint[i]; VictoryNum = i; } } }
//勝利プレイヤー判定と点数格納 public void UpdateDisplay() { for (int i = 0; i < 6; i++) { Rank[i] = 0; BattlePoint[i] = CManager.GetPlayerCost(i + 1).critical + CManager.GetPlayerCost(i + 1).crush + CManager.GetPlayerCost(i + 1).rank; } for (int i = 0; i < 6; i++) { for (int j = 0; j < 6; ++j) { if (BattlePoint[i] < BattlePoint[j]) { Rank[i]++; //順位の格納 } } } for (int i = 0; i < Rank.Length; ++i) { int num = 0; for (int j = 0; j < Rank.Length; ++j) { if (i == j) { continue; } if (Rank[i] == Rank[j]) { num++; Rank[j] += num; } } } PointSet(); RankSet(); }
// Update is called once per frame void Update() { for (int i = 0; i < 6; i++) { BattlePoints[i] = CManager.GetPlayerBattlePoint(i + 1) + CManager.GetPlayerCost(i + 1).critical + CManager.GetPlayerCost(i + 1).crush + CManager.GetPlayerCost(i + 1).rank; int ThousandPlace = (BattlePoints[i] / 1000) % 10; //100の位 int HundredPlace = (BattlePoints[i] / 100) % 10; //100の位 int TenPlace = (BattlePoints[i] / 10) % 10; //10の位 int Digit = BattlePoints[i] % 10; //1の位 Debug.Log("位確認" + ThousandPlace.ToString() + HundredPlace.ToString() + TenPlace.ToString() + Digit.ToString()); Debug.Log(CManager.GetPlayerCost(1).rank); for (int j = 0; j < 10; j++) { if (Digit == j) { if (i < 3) { PannelDigit[i].texture = Images[j]; //左右判定 } else { PannelDigit[i].texture = Images[j + 10]; } } //10の位 if (TenPlace == j) { if (ThousandPlace == 0) { if (HundredPlace == 0) { if (TenPlace != 0) { if (i < 3) { PannelTenPlace[i].texture = Images[j]; //左右判定 } else { PannelTenPlace[i].texture = Images[j + 10]; } ColsetTen(i); } } else { if (i < 3) { PannelTenPlace[i].texture = Images[j]; //左右判定 } else { PannelTenPlace[i].texture = Images[j + 10]; } ColsetTen(i); } } else { if (i < 3) { PannelTenPlace[i].texture = Images[j]; //左右判定 } else { PannelTenPlace[i].texture = Images[j + 10]; } ColsetTen(i); } } //100の位 if (HundredPlace == j) { if (ThousandPlace == 0) { if (HundredPlace != 0) { if (i < 3) { PannelHundredPlace[i].texture = Images[j]; //左右判定 } else { PannelHundredPlace[i].texture = Images[j + 10]; } ColsetHundred(i); } } else { if (i < 3) { PannelHundredPlace[i].texture = Images[j]; //左右判定 } else { PannelHundredPlace[i].texture = Images[j + 10]; } ColsetHundred(i); } } //1000 if (ThousandPlace != 0 && ThousandPlace == j) { if (i < 3) { PannelThousandPlace[i].texture = Images[j]; //左右判定 } else { PannelThousandPlace[i].texture = Images[j + 10]; } ColsetThousand(i); } } } }