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
0652cde1
Commit
0652cde1
authored
Apr 12, 2026
by
saad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new ui in challenge mode
parent
a5ccaa97
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1453 additions
and
1324 deletions
+1453
-1324
Login.unity
My project/Assets/AppUI/NewAppUI/Scene/Login.unity
+46
-0
Canvas.prefab
My project/Assets/Prefabs/CS/Canvas.prefab
+139
-138
Canvas.prefab
My project/Assets/Prefabs/MCQ/Canvas.prefab
+212
-211
TfUI.prefab
My project/Assets/Prefabs/TF/Phone Art/TfUI.prefab
+932
-933
CsGameManager.cs
My project/Assets/ScienceStreet/CS/Scripts/CsGameManager.cs
+9
-2
CsUIManager.cs
My project/Assets/ScienceStreet/CS/Scripts/CsUIManager.cs
+15
-2
ChallengeManager.cs
...sets/ScienceStreet/Features/Challenge/ChallengeManager.cs
+51
-32
McqGameManager.cs
...roject/Assets/ScienceStreet/MCQ/Scripts/McqGameManager.cs
+9
-2
McqUIManager.cs
My project/Assets/ScienceStreet/MCQ/Scripts/McqUIManager.cs
+15
-0
TfGameManager.cs
My project/Assets/ScienceStreet/TF/Scripts/TfGameManager.cs
+9
-2
TfUIManager.cs
My project/Assets/ScienceStreet/TF/Scripts/TfUIManager.cs
+16
-2
No files found.
My project/Assets/AppUI/NewAppUI/Scene/Login.unity
View file @
0652cde1
...
...
@@ -196,6 +196,51 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
Assembly-CSharp::LoginPageAnimation
loginPage
:
{
fileID
:
1971829438
}
---
!u!1
&697923396
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
697923398
}
-
component
:
{
fileID
:
697923397
}
m_Layer
:
0
m_Name
:
Transition manager
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!114
&697923397
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
697923396
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
61430b0086307cc4da3ccc8d39ae88da
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
Assembly-CSharp::EasyTransition.TransitionManager
transitionTemplate
:
{
fileID
:
5276914992623515724
,
guid
:
616d511151a6c554caddf1c754e4f91d
,
type
:
3
}
---
!u!4
&697923398
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
697923396
}
serializedVersion
:
2
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
-4.15541
,
y
:
2.46558
,
z
:
2.22055
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_ConstrainProportionsScale
:
0
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&951503749
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -645,3 +690,4 @@ SceneRoots:
-
{
fileID
:
1628372281
}
-
{
fileID
:
1093642342
}
-
{
fileID
:
2142479138
}
-
{
fileID
:
697923398
}
My project/Assets/Prefabs/CS/Canvas.prefab
View file @
0652cde1
This diff is collapsed.
Click to expand it.
My project/Assets/Prefabs/MCQ/Canvas.prefab
View file @
0652cde1
This diff is collapsed.
Click to expand it.
My project/Assets/Prefabs/TF/Phone Art/TfUI.prefab
View file @
0652cde1
This diff is collapsed.
Click to expand it.
My project/Assets/ScienceStreet/CS/Scripts/CsGameManager.cs
View file @
0652cde1
...
...
@@ -149,8 +149,16 @@ namespace com.al_arcade.cs
if
(
uiManager
!=
null
)
{
uiManager
.
ShowGameUI
();
uiManager
.
SetScore
(
0
);
uiManager
.
SetProgress
(
0
,
_questions
.
Length
);
uiManager
.
EnableScore
(
IsChallengeMode
);
if
(
IsChallengeMode
&&
ChallengeManager
.
Instance
!=
null
)
{
uiManager
.
SetScore
(
ChallengeManager
.
Instance
.
TimeSaved
);
}
else
{
uiManager
.
SetScore
(
0
);
}
}
onGameStart
?.
Invoke
();
...
...
@@ -314,7 +322,6 @@ namespace com.al_arcade.cs
if
(
uiManager
!=
null
)
{
uiManager
.
ShowFeedback
(
$"ممتاز!
{
points
}
+"
,
true
);
uiManager
.
SetScore
(
_score
);
uiManager
.
SetStreak
(
_streak
);
}
...
...
My project/Assets/ScienceStreet/CS/Scripts/CsUIManager.cs
View file @
0652cde1
...
...
@@ -20,7 +20,7 @@ namespace com.al_arcade.cs
[
SerializeField
]
protected
CanvasGroup
_optionsPanel
,
_feedbackGroup
;
[
SerializeField
]
protected
UniText
_progressText
;
[
SerializeField
]
protected
UniText
_hintText
,
_scoreText
,
_streakText
;
[
SerializeField
]
protected
UniText
_hintText
,
_scoreText
,
_streakText
,
_scoreLbl
;
[
SerializeField
]
protected
UniText
_feedbackText
;
[
SerializeField
]
protected
Image
_feedbackBg
,
_timerFill
;
...
...
@@ -508,7 +508,19 @@ namespace com.al_arcade.cs
_timerSlider
.
value
=
time
/
30f
;
_timerFill
.
color
=
time
>
4f
?
_timerDefaultColor
:
SSColorPalette
.
Danger
;
}
public
void
EnableScore
(
bool
value
)
{
_scoreText
.
enabled
=
value
;
_scoreLbl
.
enabled
=
value
;
if
(
value
)
{
_scoreLbl
.
Text
=
"الوقت الموفر"
;
}
else
{
_scoreLbl
.
Text
=
"النقاط"
;
}
}
public
void
UpdateTimer
(
float
time
,
bool
pos
)
{
isTweening
=
true
;
...
...
@@ -548,6 +560,7 @@ namespace com.al_arcade.cs
TickPoints
(
0
);
SetStreak
(
0
);
ClearOptions
();
_scoreLbl
.
enabled
=
false
;
}
public
void
TickPoints
(
int
count
)
...
...
My project/Assets/ScienceStreet/Features/Challenge/ChallengeManager.cs
View file @
0652cde1
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
com.al_arcade.shared
;
...
...
@@ -7,10 +7,11 @@ using EasyTransition;
using
Unity.VisualScripting
;
using
UnityEngine
;
// Spawns three games one after the other.
// Move to next game when the current game is won, if lost end the challenge and show results.
public
class
ChallengeManager
:
MonoBehaviour
{
// ✅ NEW: Singleton
public
static
ChallengeManager
Instance
{
get
;
private
set
;
}
[
SerializeField
]
private
List
<
string
>
gameSceneNames
=
new
();
[
SerializeField
]
private
TransitionSettings
transitionSettings
;
...
...
@@ -19,9 +20,7 @@ public class ChallengeManager : MonoBehaviour
[
SerializeField
]
private
List
<
int
>
penaltiesPerGame
=
new
()
{
200
,
150
,
100
};
// Time saved for bonus if won the challenge
private
int
timeSaved
=
0
;
private
int
currentGameIndex
=
0
;
private
DateTime
startTime
;
...
...
@@ -30,36 +29,53 @@ public class ChallengeManager : MonoBehaviour
[
SerializeField
]
private
ChallengeCanvas
challengeCanvas
;
// ✅ NEW: public read-only accessor so any game can read time saved
public
int
TimeSaved
=>
timeSaved
;
// ✅ NEW: time bonus from the PREVIOUS game to give to the NEXT game
// this is the timeLeft value passed from OnGameCompleted
private
float
_lastGameTimeLeft
=
0f
;
public
float
LastGameTimeLeft
=>
_lastGameTimeLeft
;
void
Awake
()
// ─── Singleton ────────────────────────────────────────────────────────
private
void
Awake
()
{
// ✅ NEW: singleton guard — only one ChallengeManager ever exists
if
(
Instance
!=
null
&&
Instance
!=
this
)
{
Destroy
(
gameObject
);
return
;
}
Instance
=
this
;
DontDestroyOnLoad
(
gameObject
);
}
[
ContextMenu
(
"Start Challenge"
)]
public
void
StartChallengeButton
()
private
void
OnDestroy
()
{
StartChallenge
().
Forget
();
// ✅ NEW: clear singleton ref when destroyed
if
(
Instance
==
this
)
Instance
=
null
;
}
// ─── Context Menu helpers ─────────────────────────────────────────────
[
ContextMenu
(
"Start Challenge"
)]
public
void
StartChallengeButton
()
=>
StartChallenge
().
Forget
();
[
ContextMenu
(
"Load Next"
)]
public
void
LoadNextButton
()
{
LoadNextGameAndListen
().
Forget
();
}
public
void
LoadNextButton
()
=>
LoadNextGameAndListen
().
Forget
();
[
ContextMenu
(
"Fake win"
)]
public
void
Fakewin
()
{
OnGameCompleted
(
true
,
30
,
100
);
}
public
void
Fakewin
()
=>
OnGameCompleted
(
true
,
30
,
100
);
// ─── Challenge flow ───────────────────────────────────────────────────
public
async
UniTask
StartChallenge
()
{
startTime
=
DateTime
.
UtcNow
;
currentGameIndex
=
0
;
timeSaved
=
0
;
// ✅ NEW: reset last game time left at start of fresh challenge
_lastGameTimeLeft
=
0f
;
currentGame
=
null
;
await
LoadNextGameAndListen
();
...
...
@@ -77,14 +93,16 @@ public class ChallengeManager : MonoBehaviour
return
;
}
// Add time left to the saved time for the next game
// ✅ NEW: store timeLeft so the next game can use it as a bonus
_lastGameTimeLeft
=
timeLeft
;
// Add time left to total saved time
timeSaved
+=
Mathf
.
RoundToInt
(
timeLeft
);
currentGameIndex
++;
if
(
currentGameIndex
>=
gameSceneNames
.
Count
)
{
var
pointsEarnedTotal
=
winningPoints
+
(
timeSaved
*
timeSavedBonusMultiplier
);
WonChallenge
(
timeSaved
,
pointsEarnedTotal
).
Forget
();
return
;
}
...
...
@@ -94,17 +112,17 @@ public class ChallengeManager : MonoBehaviour
private
async
UniTask
LoadNextGameAndListen
()
{
TransitionManager
.
Instance
().
Transition
(
gameSceneNames
[
currentGameIndex
],
transitionSettings
,
0
);
TransitionManager
.
Instance
().
Transition
(
gameSceneNames
[
currentGameIndex
],
transitionSettings
,
0
);
// Wait until the old game is destroyed and the new game is loaded and ready
await
UniTask
.
WaitUntil
(()
=>
baseGameManager
==
null
||
baseGameManager
.
IsDestroyed
());
await
UniTask
.
WaitUntil
(()
=>
baseGameManager
==
null
||
baseGameManager
.
IsDestroyed
());
await
UniTask
.
WaitUntil
(()
=>
{
currentGame
=
FindObjectsByType
<
MonoBehaviour
>(
FindObjectsSortMode
.
None
)
.
OfType
<
IChallengeGame
>()
.
FirstOrDefault
();
return
currentGame
!=
null
;
});
...
...
@@ -112,6 +130,9 @@ public class ChallengeManager : MonoBehaviour
print
(
"Current game: "
+
baseGameManager
.
name
);
await
UniTask
.
WaitForSeconds
(
0.5f
);
// ✅ NEW: pass the saved time bonus to the game before starting it
// each game type checks ChallengeManager.Instance.LastGameTimeLeft
// in their own BeginGameplay() — no casting needed here
baseGameManager
.
StartGame
();
currentGame
.
OnGameCompleted
+=
OnGameCompleted
;
}
...
...
@@ -119,24 +140,22 @@ public class ChallengeManager : MonoBehaviour
private
async
UniTask
LostChallenge
()
{
Debug
.
Log
(
"Challenge failed."
);
// Show results, reset challenge, etc.
challengeCanvas
.
ShowChallengeResult
(
false
,
0
,
penaltiesPerGame
[
currentGameIndex
]);
await
ChallengeService
.
Instance
.
AddChallenge
(
false
,
0
,
-
penaltiesPerGame
[
currentGameIndex
],
startTime
,
DateTime
.
UtcNow
);
challengeCanvas
.
ShowChallengeResult
(
false
,
0
,
penaltiesPerGame
[
currentGameIndex
]);
await
ChallengeService
.
Instance
.
AddChallenge
(
false
,
0
,
-
penaltiesPerGame
[
currentGameIndex
],
startTime
,
DateTime
.
UtcNow
);
}
private
async
UniTask
WonChallenge
(
int
timeSaved
,
int
pointsEarned
)
{
Debug
.
Log
(
"Challenge completed! Total time saved: "
+
timeSaved
);
challengeCanvas
.
ShowChallengeResult
(
true
,
timeSaved
,
pointsEarned
);
await
ChallengeService
.
Instance
.
AddChallenge
(
true
,
timeSaved
,
pointsEarned
,
startTime
,
DateTime
.
UtcNow
);
await
ChallengeService
.
Instance
.
AddChallenge
(
true
,
timeSaved
,
pointsEarned
,
startTime
,
DateTime
.
UtcNow
);
}
public
void
EndChallenge
()
{
Destroy
(
gameObject
,
5
);
}
}
\ No newline at end of file
My project/Assets/ScienceStreet/MCQ/Scripts/McqGameManager.cs
View file @
0652cde1
...
...
@@ -167,10 +167,18 @@ namespace com.al_arcade.mcq
if
(
uiManager
!=
null
)
{
uiManager
.
SetScore
(
0
);
// ✅ NEW: reset the points dots to 0
uiManager
.
TickPoints
(
0
);
uiManager
.
ShowGameUI
();
uiManager
.
EnableScore
(
IsChallengeMode
);
if
(
IsChallengeMode
&&
ChallengeManager
.
Instance
!=
null
)
{
uiManager
.
SetScore
(
ChallengeManager
.
Instance
.
TimeSaved
);
}
else
{
uiManager
.
SetScore
(
0
);
}
}
questionDisplay
.
transform
.
DOScale
(
Vector3
.
one
,
0.5f
)
...
...
@@ -369,7 +377,6 @@ namespace com.al_arcade.mcq
if
(
uiManager
!=
null
)
{
uiManager
.
SetScore
(
_score
);
uiManager
.
SetStreak
(
_streak
);
// ✅ NEW: update the dots UI like CS
uiManager
.
TickPoints
(
_deltaChangeInSize
);
...
...
My project/Assets/ScienceStreet/MCQ/Scripts/McqUIManager.cs
View file @
0652cde1
...
...
@@ -23,6 +23,7 @@ namespace com.al_arcade.mcq
[
Header
(
"Game UI"
)]
[
SerializeField
]
private
UniText
_scoreText
;
[
SerializeField
]
private
UniText
_scoreLbl
;
[
SerializeField
]
private
UniText
_streakText
;
[
SerializeField
]
private
UniText
_progressText
;
[
SerializeField
]
private
UniText
_loadingText
;
...
...
@@ -115,6 +116,19 @@ namespace com.al_arcade.mcq
_scoreText
.
transform
.
DOPunchScale
(
Vector3
.
one
*
0.2f
,
0.3f
,
6
,
0.3f
)
.
SetId
(
"scorePunch"
);
}
public
void
EnableScore
(
bool
value
)
{
_scoreText
.
enabled
=
value
;
_scoreLbl
.
enabled
=
value
;
if
(
value
)
{
_scoreLbl
.
Text
=
"الوقت الموفر"
;
}
else
{
_scoreLbl
.
Text
=
"النقاط"
;
}
}
public
void
SetStreak
(
int
streak
)
{
...
...
@@ -348,6 +362,7 @@ namespace com.al_arcade.mcq
_isTweening
=
false
;
SetStreak
(
0
);
_scoreLbl
.
enabled
=
false
;
}
// ─── Button functions ─────────────────────────────────────────────────
...
...
My project/Assets/ScienceStreet/TF/Scripts/TfGameManager.cs
View file @
0652cde1
...
...
@@ -102,7 +102,15 @@ namespace com.al_arcade.tf
{
uiManager
.
ShowGameUI
();
uiManager
.
SetProgress
(
0
,
stepsToWin
);
uiManager
.
SetScore
(
0
);
uiManager
.
EnableScore
(
IsChallengeMode
);
if
(
IsChallengeMode
&&
ChallengeManager
.
Instance
!=
null
)
{
uiManager
.
SetScore
(
ChallengeManager
.
Instance
.
TimeSaved
);
}
else
{
uiManager
.
SetScore
(
0
);
}
}
onGameStart
?.
Invoke
();
...
...
@@ -226,7 +234,6 @@ namespace com.al_arcade.tf
if
(
uiManager
!=
null
)
{
uiManager
.
SetProgress
(
_progress
,
stepsToWin
);
uiManager
.
SetScore
(
_score
);
uiManager
.
SetStreak
(
_streak
);
}
...
...
My project/Assets/ScienceStreet/TF/Scripts/TfUIManager.cs
View file @
0652cde1
...
...
@@ -15,7 +15,7 @@ namespace com.al_arcade.tf
{
[
SerializeField
]
private
Canvas
_canvas
;
[
SerializeField
]
private
CanvasGroup
_gameUI
,
_loadingUI
,
_errorUI
,
_resultsUI
;
[
SerializeField
]
private
UniText
_scoreText
,
_streakText
;
[
SerializeField
]
private
UniText
_scoreText
,
_streakText
,
_scoreLbl
;
[
SerializeField
]
private
ArabicTextMeshProUGUI
_loadingText
,
_errorText
;
[
SerializeField
]
private
UniText
_progressLabel
;
[
SerializeField
]
private
UniText
_resultTitle
,
_resultScore
,
_resultStats
;
...
...
@@ -338,7 +338,19 @@ namespace com.al_arcade.tf
.
DOPunchScale
(
Vector3
.
one
*
0.12f
,
0.2f
,
4
,
0.2f
)
.
SetId
(
"sp"
);
}
public
void
EnableScore
(
bool
value
)
{
_scoreText
.
enabled
=
value
;
_scoreLbl
.
enabled
=
value
;
if
(
value
)
{
_scoreLbl
.
Text
=
"الوقت الموفر"
;
}
else
{
_scoreLbl
.
Text
=
"النقاط"
;
}
}
public
void
SetStreak
(
int
s
)
{
if
(
_streakText
==
null
)
return
;
...
...
@@ -415,6 +427,7 @@ namespace com.al_arcade.tf
if
(
_loadingUI
!=
null
)
_loadingUI
.
gameObject
.
SetActive
(
false
);
if
(
_errorUI
!=
null
)
_errorUI
.
gameObject
.
SetActive
(
false
);
if
(
_resultsUI
!=
null
)
_resultsUI
.
gameObject
.
SetActive
(
false
);
// --- ADDED: Reset timer UI ---
if
(
_timerSlider
!=
null
)
_timerSlider
.
value
=
1f
;
...
...
@@ -423,6 +436,7 @@ namespace com.al_arcade.tf
_timerFill
.
color
=
_timerDefaultColor
;
_isTweening
=
false
;
_scoreLbl
.
enabled
=
false
;
}
private
GameObject
MkPanel
(
Transform
p
,
string
n
)
...
...
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