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
9c2d7323
Commit
9c2d7323
authored
Apr 12, 2026
by
Yousef Sameh
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'NewUI' of
http://gitlab.caprover.al-arcade.com/root/ssbookminigames
into NewUI
parents
bdba0ba4
d4cfc2fc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
219 additions
and
54 deletions
+219
-54
AppRouter.cs
My project/Assets/App/Infrastructure/Core/AppRouter.cs
+20
-0
HomeController.cs
My project/Assets/App/UI/HomeController.cs
+10
-0
MainmenuAnimation.cs
My project/Assets/AppUI/Scripts/MainmenuAnimation.cs
+1
-0
CsGameManager.cs
My project/Assets/ScienceStreet/CS/Scripts/CsGameManager.cs
+4
-0
McqDemoBuilder.cs
...roject/Assets/ScienceStreet/MCQ/Scripts/McqDemoBuilder.cs
+55
-20
McqGameManager.cs
...roject/Assets/ScienceStreet/MCQ/Scripts/McqGameManager.cs
+82
-31
McqGateController.cs
...ect/Assets/ScienceStreet/MCQ/Scripts/McqGateController.cs
+47
-3
No files found.
My project/Assets/App/Infrastructure/Core/AppRouter.cs
View file @
9c2d7323
...
@@ -31,6 +31,26 @@ public class AppRouter : MonoBehaviour
...
@@ -31,6 +31,26 @@ public class AppRouter : MonoBehaviour
DontDestroyOnLoad
(
gameObject
);
DontDestroyOnLoad
(
gameObject
);
Application
.
targetFrameRate
=
Screen
.
currentResolution
.
refreshRate
;
Application
.
targetFrameRate
=
Screen
.
currentResolution
.
refreshRate
;
Screen
.
orientation
=
ScreenOrientation
.
Portrait
;
}
private
void
Update
()
{
if
(
Input
.
GetKeyDown
(
KeyCode
.
Escape
))
HandleBackButton
();
}
private
void
HandleBackButton
()
{
// Don't interrupt active challenges
if
(
ChallengeManager
.
Instance
!=
null
&&
ChallengeManager
.
Instance
.
IsChallengeRunning
)
return
;
var
scene
=
SceneManager
.
GetActiveScene
().
name
;
if
(
scene
==
"MainMenu"
)
Application
.
Quit
();
else
if
(
scene
!=
"Login"
&&
scene
!=
"Boot"
)
GoToHome
();
}
}
private
async
void
Start
()
private
async
void
Start
()
...
...
My project/Assets/App/UI/HomeController.cs
View file @
9c2d7323
...
@@ -30,6 +30,9 @@ public class HomeController : MonoBehaviour
...
@@ -30,6 +30,9 @@ public class HomeController : MonoBehaviour
private
VisualElement
menuPanel
;
private
VisualElement
menuPanel
;
// Navigation guard — prevents concurrent Challenge + Practice clicks
public
static
bool
IsNavigating
{
get
;
private
set
;
}
void
Start
()
void
Start
()
{
{
var
root
=
mainMenuDocument
.
rootVisualElement
.
Q
(
"Home"
);
var
root
=
mainMenuDocument
.
rootVisualElement
.
Q
(
"Home"
);
...
@@ -141,6 +144,12 @@ public class HomeController : MonoBehaviour
...
@@ -141,6 +144,12 @@ public class HomeController : MonoBehaviour
private
void
OnChallengeButtonClicked
()
private
void
OnChallengeButtonClicked
()
{
{
if
(
IsNavigating
)
return
;
IsNavigating
=
true
;
challengeButton
.
SetEnabled
(
false
);
if
(
practiceButton
!=
null
)
practiceButton
.
SetEnabled
(
false
);
var
challenge
=
Instantiate
(
challengePrefab
);
var
challenge
=
Instantiate
(
challengePrefab
);
var
challengeManager
=
challenge
.
GetComponent
<
ChallengeManager
>();
var
challengeManager
=
challenge
.
GetComponent
<
ChallengeManager
>();
...
@@ -149,6 +158,7 @@ public class HomeController : MonoBehaviour
...
@@ -149,6 +158,7 @@ public class HomeController : MonoBehaviour
private
void
OnDestroy
()
private
void
OnDestroy
()
{
{
IsNavigating
=
false
;
UserService
.
Instance
.
OnUserChanged
-=
OnUserChange
;
UserService
.
Instance
.
OnUserChanged
-=
OnUserChange
;
challengeButton
.
clicked
-=
OnChallengeButtonClicked
;
challengeButton
.
clicked
-=
OnChallengeButtonClicked
;
}
}
...
...
My project/Assets/AppUI/Scripts/MainmenuAnimation.cs
View file @
9c2d7323
...
@@ -105,6 +105,7 @@ public class MainmenuAnimation : MonoBehaviour
...
@@ -105,6 +105,7 @@ public class MainmenuAnimation : MonoBehaviour
openPracticeButton
.
clicked
+=
()
=>
openPracticeButton
.
clicked
+=
()
=>
{
{
if
(
HomeController
.
IsNavigating
)
return
;
SelectGamePanel
.
style
.
display
=
DisplayStyle
.
Flex
;
SelectGamePanel
.
style
.
display
=
DisplayStyle
.
Flex
;
SelectGamePanel
.
experimental
.
animation
.
Start
(
0
,
1
,
200
,
(
v
,
t
)
=>
SelectGamePanel
.
experimental
.
animation
.
Start
(
0
,
1
,
200
,
(
v
,
t
)
=>
{
{
...
...
My project/Assets/ScienceStreet/CS/Scripts/CsGameManager.cs
View file @
9c2d7323
...
@@ -398,6 +398,8 @@ namespace com.al_arcade.cs
...
@@ -398,6 +398,8 @@ namespace com.al_arcade.cs
// ─── End sequences ────────────────────────────────────────────────────
// ─── End sequences ────────────────────────────────────────────────────
protected
override
IEnumerator
SharedVictorySequence
()
protected
override
IEnumerator
SharedVictorySequence
()
{
{
if
(
_isTicking
)
{
_isTicking
=
false
;
SSAudioManager
.
Instance
?.
Tick
(
false
);
}
var
audio
=
SSAudioManager
.
Instance
;
var
audio
=
SSAudioManager
.
Instance
;
audio
.
PlayVictory
();
audio
.
PlayVictory
();
...
@@ -427,6 +429,8 @@ namespace com.al_arcade.cs
...
@@ -427,6 +429,8 @@ namespace com.al_arcade.cs
protected
override
IEnumerator
SharedLoseSequence
()
protected
override
IEnumerator
SharedLoseSequence
()
{
{
if
(
_isTicking
)
{
_isTicking
=
false
;
SSAudioManager
.
Instance
?.
Tick
(
false
);
}
SSAudioManager
.
Instance
.
PlayDefeat
();
SSAudioManager
.
Instance
.
PlayDefeat
();
onGameComplete
?.
Invoke
(
_score
);
onGameComplete
?.
Invoke
(
_score
);
SSAudioManager
.
Instance
.
StopMusic
();
SSAudioManager
.
Instance
.
StopMusic
();
...
...
My project/Assets/ScienceStreet/MCQ/Scripts/McqDemoBuilder.cs
View file @
9c2d7323
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.EventSystems
;
using
UnityEngine.EventSystems
;
using
UnityEngine.Events
;
using
UnityEngine.Events
;
...
@@ -134,34 +135,68 @@ namespace com.al_arcade.mcq
...
@@ -134,34 +135,68 @@ namespace com.al_arcade.mcq
}
}
for
(
float
z
=
0
;
z
<
400
;
z
+=
4
)
// Combined dashes into a single mesh (100 objects → 1
)
{
{
var
dash
=
GameObject
.
CreatePrimitive
(
PrimitiveType
.
Cube
);
var
tempCube
=
GameObject
.
CreatePrimitive
(
PrimitiveType
.
Cube
);
dash
.
name
=
"Dash"
;
var
cubeMesh
=
tempCube
.
GetComponent
<
MeshFilter
>().
sharedMesh
;
dash
.
transform
.
position
=
new
Vector3
(
0
,
0.01f
,
z
);
Destroy
(
tempCube
);
dash
.
transform
.
localScale
=
new
Vector3
(
0.05f
,
0.01f
,
2f
);
Destroy
(
dash
.
GetComponent
<
Collider
>());
var
combines
=
new
List
<
CombineInstance
>();
dash
.
GetComponent
<
Renderer
>().
material
=
new
Material
(
shader
)
for
(
float
z
=
0
;
z
<
400
;
z
+=
4
)
{
combines
.
Add
(
new
CombineInstance
{
mesh
=
cubeMesh
,
transform
=
Matrix4x4
.
TRS
(
new
Vector3
(
0
,
0.01f
,
z
),
Quaternion
.
identity
,
new
Vector3
(
0.05f
,
0.01f
,
2f
))
});
}
var
dashObj
=
new
GameObject
(
"RoadDashes"
);
var
mf
=
dashObj
.
AddComponent
<
MeshFilter
>();
var
mr
=
dashObj
.
AddComponent
<
MeshRenderer
>();
var
combined
=
new
Mesh
();
combined
.
CombineMeshes
(
combines
.
ToArray
(),
true
,
true
);
mf
.
mesh
=
combined
;
mr
.
material
=
new
Material
(
shader
)
{
color
=
SSColorPalette
.
WithAlpha
(
Color
.
white
,
0.2f
)
};
{
color
=
SSColorPalette
.
WithAlpha
(
Color
.
white
,
0.2f
)
};
}
}
for
(
int
side
=
-
1
;
side
<=
1
;
side
+=
2
)
// Combined side blocks into a single mesh (40 objects → 1
)
{
{
for
(
float
z
=
0
;
z
<
400
;
z
+=
20
)
var
tempCube
=
GameObject
.
CreatePrimitive
(
PrimitiveType
.
Cube
);
var
cubeMesh
=
tempCube
.
GetComponent
<
MeshFilter
>().
sharedMesh
;
Destroy
(
tempCube
);
var
combines
=
new
List
<
CombineInstance
>();
for
(
int
side
=
-
1
;
side
<=
1
;
side
+=
2
)
{
{
var
block
=
GameObject
.
CreatePrimitive
(
PrimitiveType
.
Cube
);
for
(
float
z
=
0
;
z
<
400
;
z
+=
20
)
block
.
name
=
"SideBlock"
;
{
float
h
=
Random
.
Range
(
2f
,
5f
);
float
h
=
Random
.
Range
(
2f
,
5f
);
block
.
transform
.
position
=
new
Vector3
(
side
*
12f
,
h
/
2f
,
z
);
combines
.
Add
(
new
CombineInstance
block
.
transform
.
localScale
=
new
Vector3
(
{
Random
.
Range
(
2f
,
4f
),
h
,
Random
.
Range
(
3f
,
8f
));
mesh
=
cubeMesh
,
Destroy
(
block
.
GetComponent
<
Collider
>());
transform
=
Matrix4x4
.
TRS
(
var
c
=
Color
.
Lerp
(
SSColorPalette
.
Primary
,
new
Vector3
(
side
*
12f
,
h
/
2f
,
z
),
SSColorPalette
.
PrimaryLight
,
Random
.
value
);
Quaternion
.
identity
,
block
.
GetComponent
<
Renderer
>().
material
=
new
Material
(
shader
)
new
Vector3
(
Random
.
Range
(
2f
,
4f
),
h
,
Random
.
Range
(
3f
,
8f
)))
{
color
=
SSColorPalette
.
WithAlpha
(
c
,
0.4f
)
};
});
}
}
}
var
blocksObj
=
new
GameObject
(
"SideBlocks"
);
var
mf
=
blocksObj
.
AddComponent
<
MeshFilter
>();
var
mr
=
blocksObj
.
AddComponent
<
MeshRenderer
>();
var
combined
=
new
Mesh
();
combined
.
CombineMeshes
(
combines
.
ToArray
(),
true
,
true
);
mf
.
mesh
=
combined
;
var
midColor
=
Color
.
Lerp
(
SSColorPalette
.
Primary
,
SSColorPalette
.
PrimaryLight
,
0.5f
);
mr
.
material
=
new
Material
(
shader
)
{
color
=
SSColorPalette
.
WithAlpha
(
midColor
,
0.4f
)
};
}
}
...
...
My project/Assets/ScienceStreet/MCQ/Scripts/McqGameManager.cs
View file @
9c2d7323
...
@@ -50,6 +50,10 @@ namespace com.al_arcade.mcq
...
@@ -50,6 +50,10 @@ namespace com.al_arcade.mcq
private
Camera
_mainCamera
;
private
Camera
_mainCamera
;
private
bool
_isTicking
;
private
bool
_isTicking
;
// Gate object pool — reuse instead of Instantiate/Destroy per question
private
List
<
McqGateController
>
_gatePool
=
new
();
private
const
int
GatePoolSize
=
6
;
// ✅ NEW: CS-style progress counter
// ✅ NEW: CS-style progress counter
// goes +1 on correct, -1 on wrong, clamped to [0, pointsToWin]
// goes +1 on correct, -1 on wrong, clamped to [0, pointsToWin]
private
int
_deltaChangeInSize
;
private
int
_deltaChangeInSize
;
...
@@ -176,6 +180,7 @@ namespace com.al_arcade.mcq
...
@@ -176,6 +180,7 @@ namespace com.al_arcade.mcq
// ─── BeginGameplay ───────────────────────────────────────────────────
// ─── BeginGameplay ───────────────────────────────────────────────────
protected
override
void
BeginGameplay
()
protected
override
void
BeginGameplay
()
{
{
InitGatePool
();
_currentIndex
=
_score
=
_streak
=
_correctCount
=
_wrongCount
=
0
;
_currentIndex
=
_score
=
_streak
=
_correctCount
=
_wrongCount
=
0
;
_bestStreak
=
0
;
_bestStreak
=
0
;
...
@@ -327,7 +332,7 @@ namespace com.al_arcade.mcq
...
@@ -327,7 +332,7 @@ namespace com.al_arcade.mcq
DOTween
.
Kill
(
gate
.
transform
);
DOTween
.
Kill
(
gate
.
transform
);
gate
.
transform
.
DOScale
(
Vector3
.
zero
,
0.3f
)
gate
.
transform
.
DOScale
(
Vector3
.
zero
,
0.3f
)
.
SetEase
(
Ease
.
InBack
)
.
SetEase
(
Ease
.
InBack
)
.
OnComplete
(()
=>
{
if
(
gate
!=
null
)
Destroy
(
gate
.
gameObject
);
});
.
OnComplete
(()
=>
{
if
(
gate
!=
null
)
gate
.
Recycle
(
);
});
}
}
}
}
_activeGates
.
Clear
();
_activeGates
.
Clear
();
...
@@ -455,12 +460,82 @@ namespace com.al_arcade.mcq
...
@@ -455,12 +460,82 @@ namespace com.al_arcade.mcq
if
(
g
!=
null
)
if
(
g
!=
null
)
{
{
DOTween
.
Kill
(
g
.
transform
);
DOTween
.
Kill
(
g
.
transform
);
Destroy
(
g
.
gameObject
);
g
.
Recycle
(
);
}
}
}
}
_activeGates
.
Clear
();
_activeGates
.
Clear
();
}
}
// ─── Gate Pool ──────────────────────────────────────────────────────
private
void
InitGatePool
()
{
if
(
_gatePool
.
Count
>
0
)
return
;
GameObject
prefab
=
prefabBuilder
!=
null
?
prefabBuilder
.
GetGatePrefab
()
:
null
;
for
(
int
i
=
0
;
i
<
GatePoolSize
;
i
++)
{
GameObject
go
;
McqGateController
gate
;
if
(
prefab
==
null
)
{
go
=
new
GameObject
(
$"Gate_Pool_
{
i
}
"
);
gate
=
go
.
AddComponent
<
McqGateController
>();
}
else
{
go
=
Instantiate
(
prefab
);
gate
=
go
.
GetComponent
<
McqGateController
>();
}
if
(
gateParent
!=
null
)
go
.
transform
.
SetParent
(
gateParent
);
go
.
SetActive
(
false
);
_gatePool
.
Add
(
gate
);
}
}
private
McqGateController
GetGateFromPool
(
Vector3
position
,
int
index
,
string
answerText
,
bool
isCorrect
)
{
McqGateController
gate
=
null
;
for
(
int
i
=
0
;
i
<
_gatePool
.
Count
;
i
++)
{
if
(!
_gatePool
[
i
].
gameObject
.
activeSelf
)
{
gate
=
_gatePool
[
i
];
break
;
}
}
// Pool exhausted — expand
if
(
gate
==
null
)
{
GameObject
prefab
=
prefabBuilder
!=
null
?
prefabBuilder
.
GetGatePrefab
()
:
null
;
GameObject
go
;
if
(
prefab
==
null
)
{
go
=
new
GameObject
(
$"Gate_Pool_
{
_gatePool
.
Count
}
"
);
gate
=
go
.
AddComponent
<
McqGateController
>();
}
else
{
go
=
Instantiate
(
prefab
);
gate
=
go
.
GetComponent
<
McqGateController
>();
}
if
(
gateParent
!=
null
)
go
.
transform
.
SetParent
(
gateParent
);
_gatePool
.
Add
(
gate
);
}
gate
.
transform
.
position
=
position
;
gate
.
gameObject
.
SetActive
(
true
);
gate
.
Setup
(
index
,
answerText
,
isCorrect
);
return
gate
;
}
// ─── Gate Spawning ───────────────────────────────────────────────────
// ─── Gate Spawning ───────────────────────────────────────────────────
private
void
SpawnGates
(
McqQuestion
question
)
private
void
SpawnGates
(
McqQuestion
question
)
{
{
...
@@ -481,7 +556,7 @@ namespace com.al_arcade.mcq
...
@@ -481,7 +556,7 @@ namespace com.al_arcade.mcq
for
(
int
i
=
0
;
i
<
answers
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
answers
.
Length
;
i
++)
{
{
Vector3
gatePos
=
basePos
+
Vector3
.
right
*
(
startX
+
i
*
gateSpacing
);
Vector3
gatePos
=
basePos
+
Vector3
.
right
*
(
startX
+
i
*
gateSpacing
);
var
gate
=
CreateGate
(
gatePos
,
i
,
answers
[
i
],
i
==
_correctGateIndex
);
var
gate
=
GetGateFromPool
(
gatePos
,
i
,
answers
[
i
],
i
==
_correctGateIndex
);
_activeGates
.
Add
(
gate
);
_activeGates
.
Add
(
gate
);
gate
.
transform
.
DOScale
(
Vector3
.
one
,
0.5f
)
gate
.
transform
.
DOScale
(
Vector3
.
one
,
0.5f
)
...
@@ -491,34 +566,6 @@ namespace com.al_arcade.mcq
...
@@ -491,34 +566,6 @@ namespace com.al_arcade.mcq
}
}
}
}
private
McqGateController
CreateGate
(
Vector3
position
,
int
index
,
string
answerText
,
bool
isCorrect
)
{
GameObject
gatePrefab
=
prefabBuilder
!=
null
?
prefabBuilder
.
GetGatePrefab
()
:
null
;
GameObject
go
;
if
(
gatePrefab
==
null
)
{
go
=
new
GameObject
(
$"Gate_
{
index
}
"
);
go
.
transform
.
position
=
position
;
}
else
{
go
=
Instantiate
(
gatePrefab
,
position
,
Quaternion
.
identity
);
}
if
(
gateParent
!=
null
)
go
.
transform
.
SetParent
(
gateParent
);
McqGateController
gate
;
if
(
gatePrefab
==
null
)
gate
=
go
.
AddComponent
<
McqGateController
>();
else
gate
=
go
.
GetComponent
<
McqGateController
>();
gate
.
Setup
(
index
,
answerText
,
isCorrect
);
return
gate
;
}
// ─── Feedback ────────────────────────────────────────────────────────
// ─── Feedback ────────────────────────────────────────────────────────
private
void
ShowCorrectFeedback
(
int
points
)
private
void
ShowCorrectFeedback
(
int
points
)
{
{
...
@@ -582,6 +629,8 @@ namespace com.al_arcade.mcq
...
@@ -582,6 +629,8 @@ namespace com.al_arcade.mcq
// ─── End Sequences ───────────────────────────────────────────────────
// ─── End Sequences ───────────────────────────────────────────────────
protected
override
IEnumerator
SharedVictorySequence
()
protected
override
IEnumerator
SharedVictorySequence
()
{
{
if
(
_isTicking
)
{
_isTicking
=
false
;
SSAudioManager
.
Instance
?.
Tick
(
false
);
}
var
audio
=
SSAudioManager
.
Instance
;
var
audio
=
SSAudioManager
.
Instance
;
if
(
audio
!=
null
)
if
(
audio
!=
null
)
{
{
...
@@ -606,6 +655,8 @@ namespace com.al_arcade.mcq
...
@@ -606,6 +655,8 @@ namespace com.al_arcade.mcq
protected
override
IEnumerator
SharedLoseSequence
()
protected
override
IEnumerator
SharedLoseSequence
()
{
{
if
(
_isTicking
)
{
_isTicking
=
false
;
SSAudioManager
.
Instance
?.
Tick
(
false
);
}
StopPlayerAndCompetitor
();
StopPlayerAndCompetitor
();
var
audio
=
SSAudioManager
.
Instance
;
var
audio
=
SSAudioManager
.
Instance
;
...
...
My project/Assets/ScienceStreet/MCQ/Scripts/McqGateController.cs
View file @
9c2d7323
...
@@ -24,6 +24,7 @@ namespace com.al_arcade.mcq
...
@@ -24,6 +24,7 @@ namespace com.al_arcade.mcq
private
MaterialPropertyBlock
_mpb
;
private
MaterialPropertyBlock
_mpb
;
private
Sequence
_idleAnim
;
private
Sequence
_idleAnim
;
private
Sequence
_glowAnim
;
private
Sequence
_glowAnim
;
private
bool
_built
;
private
const
float
GateWidth
=
2.5f
;
private
const
float
GateWidth
=
2.5f
;
private
const
float
GateHeight
=
3.5f
;
private
const
float
GateHeight
=
3.5f
;
...
@@ -48,12 +49,33 @@ namespace com.al_arcade.mcq
...
@@ -48,12 +49,33 @@ namespace com.al_arcade.mcq
IsCorrect
=
correct
;
IsCorrect
=
correct
;
WasEntered
=
false
;
WasEntered
=
false
;
BuildVisuals
();
EnsureMaterial
();
if
(
_built
)
UpdateContent
();
else
{
BuildVisuals
();
_built
=
true
;
}
if
(
_mpb
!=
null
)
SetPanelColor
(
SSColorPalette
.
GateDefault
);
StartIdleAnimation
();
StartIdleAnimation
();
}
}
public
void
Start
()
public
void
Start
()
{
{
EnsureMaterial
();
if
(
_mpb
!=
null
)
SetPanelColor
(
SSColorPalette
.
GateDefault
);
}
private
void
EnsureMaterial
()
{
if
(
_panelRenderer
==
null
||
_mpb
!=
null
)
return
;
if
(
_sharedGateMaterial
==
null
)
if
(
_sharedGateMaterial
==
null
)
{
{
_sharedGateMaterial
=
new
Material
(
_panelRenderer
.
material
.
shader
);
_sharedGateMaterial
=
new
Material
(
_panelRenderer
.
material
.
shader
);
...
@@ -61,9 +83,7 @@ namespace com.al_arcade.mcq
...
@@ -61,9 +83,7 @@ namespace com.al_arcade.mcq
}
}
_panelRenderer
.
sharedMaterial
=
_sharedGateMaterial
;
_panelRenderer
.
sharedMaterial
=
_sharedGateMaterial
;
_panelMaterial
=
_sharedGateMaterial
;
_panelMaterial
=
_sharedGateMaterial
;
_mpb
=
new
MaterialPropertyBlock
();
_mpb
=
new
MaterialPropertyBlock
();
SetPanelColor
(
SSColorPalette
.
GateDefault
);
}
}
private
void
SetPanelColor
(
Color
color
)
private
void
SetPanelColor
(
Color
color
)
...
@@ -73,6 +93,30 @@ namespace com.al_arcade.mcq
...
@@ -73,6 +93,30 @@ namespace com.al_arcade.mcq
_panelRenderer
.
SetPropertyBlock
(
_mpb
);
_panelRenderer
.
SetPropertyBlock
(
_mpb
);
}
}
private
void
UpdateContent
()
{
if
(
_answerText
!=
null
)
{
_answerText
.
Text
=
AnswerText
;
_answerTextShadow
.
Text
=
AnswerText
;
}
else
if
(
_label
!=
null
)
{
_label
.
arabicText
=
AnswerText
;
}
}
public
void
Recycle
()
{
KillAllTweens
();
WasEntered
=
false
;
onPlayerEnter
=
null
;
transform
.
localScale
=
Vector3
.
one
;
if
(
_mpb
!=
null
)
SetPanelColor
(
SSColorPalette
.
GateDefault
);
gameObject
.
SetActive
(
false
);
}
private
void
BuildVisuals
()
private
void
BuildVisuals
()
{
{
var
shader
=
GetShader
();
var
shader
=
GetShader
();
...
...
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