Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSBookMinigames
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
SSBookMinigames
Commits
c7279f62
Commit
c7279f62
authored
Apr 12, 2026
by
mohamed20047
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add best streak. and handle its UI in result menu
parent
173a851c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
25 deletions
+29
-25
CsGameManager.cs
My project/Assets/ScienceStreet/CS/Scripts/CsGameManager.cs
+5
-3
CsUIManager.cs
My project/Assets/ScienceStreet/CS/Scripts/CsUIManager.cs
+5
-4
McqGameManager.cs
...roject/Assets/ScienceStreet/MCQ/Scripts/McqGameManager.cs
+3
-6
McqUIManager.cs
My project/Assets/ScienceStreet/MCQ/Scripts/McqUIManager.cs
+4
-3
BaseGameManager.cs
...ct/Assets/ScienceStreet/Shared/Scripts/BaseGameManager.cs
+2
-1
TfGameManager.cs
My project/Assets/ScienceStreet/TF/Scripts/TfGameManager.cs
+6
-5
TfUIManager.cs
My project/Assets/ScienceStreet/TF/Scripts/TfUIManager.cs
+4
-3
No files found.
My project/Assets/ScienceStreet/CS/Scripts/CsGameManager.cs
View file @
c7279f62
...
...
@@ -154,7 +154,7 @@ namespace com.al_arcade.cs
protected
override
void
BeginGameplay
()
{
_currentIndex
=
_score
=
_streak
=
_correctCount
=
_wrongCount
=
0
;
_currentIndex
=
_score
=
_streak
=
_correctCount
=
_wrongCount
=
_bestStreak
=
0
;
_deltaChangeInSize
=
0
;
_timeLeft
=
CsPrefabBuilder
.
Instance
.
startTime
;
// CS uses its own start time
_timerRunning
=
true
;
...
...
@@ -225,6 +225,7 @@ namespace com.al_arcade.cs
AdjustTimer
(-
CsPrefabBuilder
.
Instance
.
wrongAnswerPenaltyTime
);
_wrongClicks
++;
_wordClickLocked
=
true
;
_streak
=
0
;
// reset streak when click on worng word
wordButton
.
ShakeWrong
();
SSAudioManager
.
Instance
?.
PlayWrongBeep
();
StartCoroutine
(
UnlockAfterCooldown
());
...
...
@@ -323,6 +324,7 @@ namespace com.al_arcade.cs
_state
=
CsGameState
.
Feedback
;
_correctCount
++;
_streak
++;
if
(
_streak
>
_bestStreak
)
_bestStreak
=
_streak
;
_deltaChangeInSize
++;
AdjustTimer
(
CsPrefabBuilder
.
Instance
.
correctAnswerBonusTime
);
...
...
@@ -415,7 +417,7 @@ namespace com.al_arcade.cs
StartCoroutine
(
DelayedAction
(
0.7f
,
()
=>
SSAudioManager
.
Instance
.
PlayCheer
()));
// shared helper
yield
return
new
WaitForSeconds
(
1f
);
uiManager
?.
ShowResults
(
_score
,
_correctCount
,
_wrongClicks
,
_questions
.
Length
,
_
s
treak
);
uiManager
?.
ShowResults
(
_score
,
_correctCount
,
_wrongClicks
,
_questions
.
Length
,
_
bestS
treak
);
onGameComplete
?.
Invoke
(
_score
);
ClearWordButtons
();
...
...
@@ -423,7 +425,7 @@ namespace com.al_arcade.cs
protected
override
IEnumerator
NoChallengeLoseSequence
()
{
uiManager
?.
ShowResults
(
_score
,
_correctCount
,
_wrongClicks
,
_questions
.
Length
,
_
s
treak
,
false
);
uiManager
?.
ShowResults
(
_score
,
_correctCount
,
_wrongClicks
,
_questions
.
Length
,
_
bestS
treak
,
false
);
yield
return
null
;
}
...
...
My project/Assets/ScienceStreet/CS/Scripts/CsUIManager.cs
View file @
c7279f62
...
...
@@ -476,12 +476,13 @@ namespace com.al_arcade.cs
_resultsUI
.
alpha
=
0
;
float
pct
=
total
>
0
?
(
float
)
correct
/
total
*
100f
:
0
;
if
(
_resultTitle
!=
null
)
_resultTitle
.
Text
=
win
?
pct
>=
70
?
"أحسنت!"
:
"عمل جيد!"
:
"حظ اوفر"
;
if
(
_resultScore
!=
null
)
_resultScore
.
Text
=
score
.
ToString
(
"N0"
);
//
if (_resultTitle != null)
//
_resultTitle.Text = win ? pct >= 70 ? "أحسنت!" : "عمل جيد!" : "حظ اوفر";
//
if (_resultScore != null) _resultScore.Text = score.ToString("N0");
if
(
_resultStats
!=
null
)
_resultStats
.
Text
=
$"صحيح:
{
correct
}
| "
+
$"المحاولات الخاطئة:
{
wrong
}
"
;
$"المحاولات الخاطئة:
{
wrong
}
| "
+
$"أعلى سلسلة:
{
bestStreak
}
"
;
var
seq
=
DOTween
.
Sequence
();
seq
.
Append
(
_resultsUI
.
DOFade
(
1f
,
0.5f
));
...
...
My project/Assets/ScienceStreet/MCQ/Scripts/McqGameManager.cs
View file @
c7279f62
...
...
@@ -43,7 +43,7 @@ namespace com.al_arcade.mcq
public
McqGameState
State
=>
_state
;
private
McqQuestion
[]
_questions
;
private
int
_bestStreak
;
private
List
<
McqGateController
>
_activeGates
=
new
();
private
int
_correctGateIndex
=
-
1
;
private
int
_selectedGateIndex
=
-
1
;
...
...
@@ -224,7 +224,6 @@ namespace com.al_arcade.mcq
{
ResetBaseState
();
_state
=
McqGameState
.
Idle
;
_bestStreak
=
0
;
_isTicking
=
false
;
// ✅ NEW: reset delta on full reset
_deltaChangeInSize
=
0
;
...
...
@@ -651,7 +650,7 @@ namespace com.al_arcade.mcq
yield
return
new
WaitForSeconds
(
0.5f
);
if
(
uiManager
!=
null
)
uiManager
.
ShowResults
(
_score
,
_correctCount
,
_wrongCount
,
_bestStreak
,
_questions
.
Length
,
true
);
_questions
.
Length
,
_bestStreak
,
true
);
onGameComplete
?.
Invoke
(
_score
);
}
...
...
@@ -676,11 +675,9 @@ namespace com.al_arcade.mcq
yield
return
new
WaitForSeconds
(
0.5f
);
if
(
uiManager
!=
null
)
uiManager
.
ShowResults
(
_score
,
_correctCount
,
_wrongCount
,
_
bestStreak
,
_questions
.
Length
,
false
);
_
questions
.
Length
,
_bestStreak
,
false
);
onGameOver
?.
Invoke
();
}
public
int
BestStreak
=>
_bestStreak
;
public
int
TotalQuestions
=>
_questions
?.
Length
??
0
;
}
}
\ No newline at end of file
My project/Assets/ScienceStreet/MCQ/Scripts/McqUIManager.cs
View file @
c7279f62
...
...
@@ -294,11 +294,12 @@ namespace com.al_arcade.mcq
_resultsUI
.
gameObject
.
SetActive
(
true
);
_resultsUI
.
alpha
=
0
;
if
(
_resultTitle
!=
null
)
_resultTitle
.
Text
=
win
?
"أحسنت!"
:
"حظ أوفر!"
;
if
(
_resultScore
!=
null
)
_resultScore
.
Text
=
score
.
ToString
(
"N0"
);
//
if (_resultTitle != null) _resultTitle.Text = win ? "أحسنت!" : "حظ أوفر!";
//
if (_resultScore != null) _resultScore.Text = score.ToString("N0");
if
(
_resultStats
!=
null
)
_resultStats
.
Text
=
$"صحيح:
{
correct
}
| "
+
$"المحاولات الخاطئة:
{
wrong
}
"
;
$"المحاولات الخاطئة:
{
wrong
}
| "
+
$"أعلى سلسلة:
{
bestStreak
}
"
;
;
if
(
_winIcon
!=
null
)
_winIcon
.
SetActive
(
win
);
if
(
_loseIcon
!=
null
)
_loseIcon
.
SetActive
(!
win
);
...
...
My project/Assets/ScienceStreet/Shared/Scripts/BaseGameManager.cs
View file @
c7279f62
...
...
@@ -30,6 +30,7 @@ namespace com.al_arcade.shared
// ─── Shared runtime state ────────────────────────────────────────────
protected
int
_score
;
protected
int
_streak
;
protected
int
_bestStreak
;
protected
int
_correctCount
;
protected
int
_wrongCount
;
protected
int
_currentIndex
;
...
...
@@ -219,7 +220,7 @@ namespace com.al_arcade.shared
protected
void
ResetBaseState
()
{
StopAllCoroutines
();
_score
=
_streak
=
_correctCount
=
_wrongCount
=
_currentIndex
=
_totalAsked
=
0
;
_score
=
_streak
=
_correctCount
=
_wrongCount
=
_currentIndex
=
_totalAsked
=
_bestStreak
=
0
;
_timeLeft
=
0f
;
_timerRunning
=
false
;
}
...
...
My project/Assets/ScienceStreet/TF/Scripts/TfGameManager.cs
View file @
c7279f62
...
...
@@ -99,7 +99,7 @@ namespace com.al_arcade.tf
protected
override
void
BeginGameplay
()
{
_progress
=
0
;
_currentIndex
=
_score
=
_streak
=
_correctCount
=
_wrongCount
=
_totalAsked
=
0
;
_currentIndex
=
_score
=
_streak
=
_correctCount
=
_wrongCount
=
_totalAsked
=
_bestStreak
=
0
;
_state
=
TfGameState
.
Playing
;
if
(
uiManager
!=
null
)
...
...
@@ -199,6 +199,7 @@ namespace com.al_arcade.tf
{
_correctCount
++;
_streak
++;
if
(
_streak
>
_bestStreak
)
_bestStreak
=
_streak
;
_progress
++;
int
points
=
CalculateStreakScore
();
_score
+=
points
;
...
...
@@ -212,7 +213,7 @@ namespace com.al_arcade.tf
if
(
handController
!=
null
)
handController
.
PlayCorrectFeedback
(
playerSaidTrue
);
if
(
productionLine
!=
null
)
yield
return
productionLine
.
MoveForward
(
stepDistance
);
if
(
questionScreen
!=
null
)
questionScreen
.
ShowFeedback
(
true
,
_streak
);
//
if (questionScreen != null) questionScreen.ShowFeedback(true, _streak);
if
(
uiManager
!=
null
)
uiManager
.
ShowFeedback
(
$"ممتاز!"
,
true
);
...
...
@@ -239,7 +240,7 @@ namespace com.al_arcade.tf
if
(
handController
!=
null
)
handController
.
PlayWrongFeedback
(
playerSaidTrue
);
if
(
productionLine
!=
null
)
yield
return
productionLine
.
MoveBackward
(
stepDistance
);
if
(
questionScreen
!=
null
)
questionScreen
.
ShowFeedback
(
false
,
0
);
//
if (questionScreen != null) questionScreen.ShowFeedback(false, 0);
if
(
uiManager
!=
null
)
uiManager
.
ShowFeedback
(
"حاول مرة أخرى"
,
false
);
...
...
@@ -305,7 +306,7 @@ namespace com.al_arcade.tf
protected
override
IEnumerator
NoChallengeLoseSequence
()
{
yield
return
new
WaitForSeconds
(
1f
);
uiManager
?.
ShowResults
(
_score
,
_correctCount
,
_wrongCount
,
_questions
.
Length
,
_
s
treak
,
false
);
uiManager
?.
ShowResults
(
_score
,
_correctCount
,
_wrongCount
,
_questions
.
Length
,
_
bestS
treak
,
false
);
onGameOver
?.
Invoke
();
}
...
...
@@ -327,7 +328,7 @@ namespace com.al_arcade.tf
protected
override
IEnumerator
NoChallengeVictorySequence
()
{
yield
return
new
WaitForSeconds
(
1.5f
);
uiManager
?.
ShowResults
(
_score
,
_correctCount
,
_wrongCount
,
_questions
.
Length
,
_
s
treak
);
uiManager
?.
ShowResults
(
_score
,
_correctCount
,
_wrongCount
,
_questions
.
Length
,
_
bestS
treak
);
onGameComplete
?.
Invoke
();
}
...
...
My project/Assets/ScienceStreet/TF/Scripts/TfUIManager.cs
View file @
c7279f62
...
...
@@ -234,11 +234,12 @@ namespace com.al_arcade.tf
_resultsUI
.
gameObject
.
SetActive
(
true
);
_resultsUI
.
alpha
=
0
;
if
(
_resultTitle
!=
null
)
_resultTitle
.
Text
=
win
?
"نجحت المهمة"
:
"حاول مجدداً"
;
if
(
_resultScore
!=
null
)
_resultScore
.
Text
=
score
.
ToString
(
"N0"
);
//
if (_resultTitle != null) _resultTitle.Text = win ? "نجحت المهمة" : "حاول مجدداً";
//
if (_resultScore != null) _resultScore.Text = score.ToString("N0");
if
(
_resultStats
!=
null
)
_resultStats
.
Text
=
$"صحيح:
{
correct
}
| "
+
$"المحاولات الخاطئة:
{
wrong
}
"
;
$"المحاولات الخاطئة:
{
wrong
}
| "
+
$"أعلى سلسلة:
{
bestStreak
}
"
;
;
var
seq
=
DOTween
.
Sequence
();
seq
.
Append
(
_resultsUI
.
DOFade
(
1
,
0.4f
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment