Commit 7df88fa9 authored by saad's avatar saad

standardize ui for all games

parent 0652cde1
......@@ -36,7 +36,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 22.572838, y: -25.96685}
m_SizeDelta: {x: 51.9337, y: 51.9337}
m_SizeDelta: {x: 0, y: 51.9337}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9055497536415541340
CanvasRenderer:
......@@ -871,7 +871,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 144.8642, y: -25.96685}
m_SizeDelta: {x: 51.9337, y: 51.9337}
m_SizeDelta: {x: 0, y: 51.9337}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6316850651786239132
CanvasRenderer:
......@@ -1213,7 +1213,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 83.71851, y: -25.96685}
m_SizeDelta: {x: 51.9337, y: 51.9337}
m_SizeDelta: {x: 0, y: 51.9337}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6319844450247911941
CanvasRenderer:
......@@ -1412,7 +1412,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &810524042309484015
RectTransform:
m_ObjectHideFlags: 0
......@@ -1523,8 +1523,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 16, y: 25.967}
m_SizeDelta: {x: 76.011, y: 51.934}
m_AnchoredPosition: {x: 20, y: 25.967}
m_SizeDelta: {x: 118.7, y: 51.934}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &8147257740575675822
CanvasRenderer:
......@@ -1599,7 +1599,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &5824509147393400757
RectTransform:
m_ObjectHideFlags: 0
......@@ -2198,7 +2198,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 206.00986, y: -25.96685}
m_SizeDelta: {x: 51.9337, y: 51.9337}
m_SizeDelta: {x: 0, y: 51.9337}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3778932895135096301
CanvasRenderer:
......@@ -2395,6 +2395,9 @@ MonoBehaviour:
_timerFill: {fileID: 2112913333798308398}
_timerText: {fileID: 0}
_maxTime: 30
_pointsContainer: {fileID: 5824509147393400757}
_activePointColor: {r: 0.99607843, g: 0.8431373, b: 0, a: 1}
_inactivePointColor: {r: 0.99607843, g: 0.8431373, b: 0, a: 0.5411765}
onRestartClicked:
m_PersistentCalls:
m_Calls: []
......@@ -2626,7 +2629,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &5776870742342999693
RectTransform:
m_ObjectHideFlags: 0
......@@ -2828,7 +2831,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 267.15555, y: -25.96685}
m_SizeDelta: {x: 51.9337, y: 51.9337}
m_SizeDelta: {x: 0, y: 51.9337}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1293769170803587111
CanvasRenderer:
......@@ -3108,7 +3111,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &7626717906572486054
RectTransform:
m_ObjectHideFlags: 0
......@@ -3347,7 +3350,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &4797898653388170541
RectTransform:
m_ObjectHideFlags: 0
......
......@@ -94,7 +94,6 @@ namespace com.al_arcade.tf
protected override void BeginGameplay()
{
_progress = 0;
// Reset base counters
_currentIndex = _score = _streak = _correctCount = _wrongCount = _totalAsked = 0;
_state = TfGameState.Playing;
......@@ -102,6 +101,8 @@ namespace com.al_arcade.tf
{
uiManager.ShowGameUI();
uiManager.SetProgress(0, stepsToWin);
// ✅ NEW: reset points dots
uiManager.TickPoints(0);
uiManager.EnableScore(IsChallengeMode);
if (IsChallengeMode && ChallengeManager.Instance != null)
{
......@@ -133,7 +134,7 @@ namespace com.al_arcade.tf
public void ResetGame()
{
ResetBaseState(); // clears shared counters + stops coroutines
ResetBaseState();
_state = TfGameState.Idle;
_progress = 0;
_questions = null;
......@@ -147,7 +148,6 @@ namespace com.al_arcade.tf
}
// ─── Timer feedback override ──────────────────────────────────────────
// TF adjusts time on correct/wrong, so it needs direct access
public float GetTimeLeft() => _timeLeft;
// ─── Game loop ────────────────────────────────────────────────────────
......@@ -186,7 +186,7 @@ namespace com.al_arcade.tf
_correctCount++;
_streak++;
_progress++;
_score += CalculateStreakScore(); // shared helper
_score += CalculateStreakScore();
if (handController != null) handController.PlayCorrectFeedback(playerSaidTrue);
if (productionLine != null) yield return productionLine.MoveForward(stepDistance);
......@@ -200,7 +200,7 @@ namespace com.al_arcade.tf
if (particles != null)
particles.PlayCorrectBurst(new Vector3(-2, 6f, 13));
UpdateTimerBy(4f); // shared helper
UpdateTimerBy(4f);
uiManager?.UpdateTimer(_timeLeft, true);
}
else
......@@ -224,7 +224,7 @@ namespace com.al_arcade.tf
.SetEase(Ease.OutQuad).SetId("camShake");
}
UpdateTimerBy(-2f); // shared helper
UpdateTimerBy(-2f);
uiManager?.UpdateTimer(_timeLeft, false);
}
......@@ -235,6 +235,8 @@ namespace com.al_arcade.tf
{
uiManager.SetProgress(_progress, stepsToWin);
uiManager.SetStreak(_streak);
// ✅ NEW: update points dots
uiManager.TickPoints(_progress);
}
yield return new WaitForSeconds(feedbackDuration);
......@@ -288,7 +290,6 @@ namespace com.al_arcade.tf
protected override IEnumerator NoChallengeVictorySequence()
{
yield return new WaitForSeconds(1.5f);
uiManager?.ShowResults(_score, _correctCount, _wrongCount, true);
onGameComplete?.Invoke();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment