some updates
This commit is contained in:
@@ -835,6 +835,11 @@ public class teamUIController : MonoBehaviour
|
||||
public TextMeshProUGUI constructionName;
|
||||
[Tooltip("Documentation text normalized.")]
|
||||
public Text comboCounter;
|
||||
[Header("Realtime Judge Stats")]
|
||||
public Text currentComboText;
|
||||
public Text currentAccuracyText;
|
||||
public SpriteNumberDisplay currentComboSpriteDisplay;
|
||||
public SpriteNumberDisplay currentAccuracySpriteDisplay;
|
||||
[Tooltip("Documentation text normalized.")]
|
||||
public TextMeshProUGUI enemyCounter;
|
||||
[SerializeField] private int enemyCounterMax; // Documentation text normalized.
|
||||
@@ -885,6 +890,10 @@ public class teamUIController : MonoBehaviour
|
||||
private int combo = 0;
|
||||
public int CurrentCombo => combo;
|
||||
private Tween recentPlusAmountFadeTween;
|
||||
private const float RealtimePerfectWeight = 1f;
|
||||
private const float RealtimeGreatWeight = 0.6666667f;
|
||||
private const float RealtimeGoodWeight = 0.333333f;
|
||||
private const float RealtimeMissWeight = 0f;
|
||||
|
||||
public enum ComboJudgeType
|
||||
{
|
||||
@@ -1201,6 +1210,8 @@ public class teamUIController : MonoBehaviour
|
||||
recentPlusAmountText.color = color;
|
||||
}
|
||||
|
||||
RefreshRealtimeJudgeStatsText();
|
||||
|
||||
if (ScoreManager.Instance != null)
|
||||
{
|
||||
ScoreManager.Instance.RefreshAllScoreUi();
|
||||
@@ -1279,6 +1290,8 @@ public class teamUIController : MonoBehaviour
|
||||
comboCounter.text = _sb.ToString();
|
||||
}
|
||||
|
||||
RefreshRealtimeJudgeStatsText();
|
||||
|
||||
// --- Statistics: Update achievement tracking for combo ---
|
||||
if (InGamePerformanceManager.Instance != null)
|
||||
{
|
||||
@@ -1294,6 +1307,65 @@ public class teamUIController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshRealtimeJudgeStatsText()
|
||||
{
|
||||
if (currentComboText != null)
|
||||
{
|
||||
currentComboText.text = combo.ToString();
|
||||
}
|
||||
|
||||
if (currentComboSpriteDisplay != null)
|
||||
{
|
||||
currentComboSpriteDisplay.SetNumber(combo);
|
||||
}
|
||||
|
||||
bool hasAccuracyText = currentAccuracyText != null;
|
||||
bool hasAccuracySprite = currentAccuracySpriteDisplay != null;
|
||||
if (!hasAccuracyText && !hasAccuracySprite)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ScoreManager scoreManager = ScoreManager.Instance;
|
||||
if (scoreManager == null)
|
||||
{
|
||||
SetRealtimeAccuracyDisplay("0.00%");
|
||||
return;
|
||||
}
|
||||
|
||||
int perfect = Mathf.Max(0, scoreManager.countPerfect);
|
||||
int great = Mathf.Max(0, scoreManager.countGreat);
|
||||
int good = Mathf.Max(0, scoreManager.countGood);
|
||||
int miss = Mathf.Max(0, scoreManager.countMiss);
|
||||
int total = perfect + great + good + miss;
|
||||
if (total <= 0)
|
||||
{
|
||||
SetRealtimeAccuracyDisplay("0.00%");
|
||||
return;
|
||||
}
|
||||
|
||||
float accuracy =
|
||||
(perfect * RealtimePerfectWeight +
|
||||
great * RealtimeGreatWeight +
|
||||
good * RealtimeGoodWeight +
|
||||
miss * RealtimeMissWeight) / total * 100f;
|
||||
|
||||
SetRealtimeAccuracyDisplay(accuracy.ToString("F2") + "%");
|
||||
}
|
||||
|
||||
private void SetRealtimeAccuracyDisplay(string value)
|
||||
{
|
||||
if (currentAccuracyText != null)
|
||||
{
|
||||
currentAccuracyText.text = value;
|
||||
}
|
||||
|
||||
if (currentAccuracySpriteDisplay != null)
|
||||
{
|
||||
currentAccuracySpriteDisplay.SetText(value);
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetRecentPlusAmountVisual()
|
||||
{
|
||||
if (recentPlusAmountText == null)
|
||||
|
||||
Reference in New Issue
Block a user