Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Artery Runner
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
Abdulrahman Mohammed
Artery Runner
Commits
9eaf4bfd
Commit
9eaf4bfd
authored
Jan 23, 2026
by
Abdulrahman Mohammed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add effect when player only triggers obstacle
parent
738b438a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
11 deletions
+27
-11
Game.unity
Assets/_project/Scenes/Game.unity
+1
-1
NPCsEffects.cs
Assets/_project/Scripts/Systems/NPCs/NPCsEffects.cs
+4
-4
Obstacles.cs
Assets/_project/Scripts/Systems/Obstacles/Obstacles.cs
+4
-0
SpawnQuestion.cs
Assets/_project/Scripts/Systems/Spwan/SpawnQuestion.cs
+5
-4
EffectsManager.cs
Assets/_project/Scripts/Systems/VFX/EffectsManager.cs
+13
-2
No files found.
Assets/_project/Scenes/Game.unity
View file @
9eaf4bfd
...
...
@@ -199,7 +199,7 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
90d407e88a00e3747a2a730f56ab8436
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
randomQuestionEveryRound
:
0
randomQuestionEveryRound
:
1
areaLength
:
30
QuestionParent
:
{
fileID
:
1448207616
}
questionAreaPrefab
:
{
fileID
:
4538400059142529437
,
guid
:
3db7dbd8c06879542881cceaa4d90f40
,
...
...
Assets/_project/Scripts/Systems/NPCs/NPCsEffects.cs
View file @
9eaf4bfd
...
...
@@ -17,8 +17,8 @@ public class NPCsEffects : MonoBehaviour
}
private
void
OnDisable
()
{
if
(
EffectsManager
.
_playersAndNPCsMeshRenderer
.
Contains
(
GetComponentInChildren
<
MeshRenderer
>()))
EffectsManager
.
_playersAndNPCsMeshRenderer
.
Remove
(
GetComponentInChildren
<
MeshRenderer
>());
if
(
EffectsManager
.
Instance
.
_playersAndNPCsMeshRenderer
.
Contains
(
GetComponentInChildren
<
MeshRenderer
>()))
EffectsManager
.
Instance
.
_playersAndNPCsMeshRenderer
.
Remove
(
GetComponentInChildren
<
MeshRenderer
>());
if
(
OnDisableEffect
!=
null
)
{
OnDisableEffect
.
transform
.
position
=
transform
.
position
+
transform
.
forward
;
...
...
@@ -32,8 +32,8 @@ public class NPCsEffects : MonoBehaviour
}
private
void
OnEnable
()
{
if
(!
EffectsManager
.
_playersAndNPCsMeshRenderer
.
Contains
(
GetComponentInChildren
<
MeshRenderer
>()))
EffectsManager
.
_playersAndNPCsMeshRenderer
.
Add
(
GetComponentInChildren
<
MeshRenderer
>());
if
(!
EffectsManager
.
Instance
.
_playersAndNPCsMeshRenderer
.
Contains
(
GetComponentInChildren
<
MeshRenderer
>()))
EffectsManager
.
Instance
.
_playersAndNPCsMeshRenderer
.
Add
(
GetComponentInChildren
<
MeshRenderer
>());
if
(
OnEnableEffect
!=
null
)
{
...
...
Assets/_project/Scripts/Systems/Obstacles/Obstacles.cs
View file @
9eaf4bfd
...
...
@@ -10,5 +10,9 @@ public class Obstacles : MonoBehaviour
other
.
gameObject
.
SetActive
(
false
);
SpwanManager
.
Instance
.
ChangeCurrentNPCsInGame
();
}
if
(
other
.
CompareTag
(
"Player"
))
{
EffectsManager
.
Instance
.
PlayVFX
(
false
);
}
}
}
Assets/_project/Scripts/Systems/Spwan/SpawnQuestion.cs
View file @
9eaf4bfd
...
...
@@ -55,15 +55,16 @@ public class SpawnQuestion : MonoBehaviour
}
Instantiate
(
enemyAreaPrefab
,
new
Vector3
(
0
,
0
,
currentLenght
),
Quaternion
.
identity
,
QuestionParent
);
}
void
ShuffleArray
(
Question
[]
array
)
// Fisher-Yates Shuffle Algorithm
private
void
ShuffleArray
(
Question
[]
array
)
{
for
(
int
i
=
array
.
Length
-
1
;
i
>
0
;
i
--)
for
(
int
i
=
questionScriptableObjects
.
Length
-
1
;
i
>
1
;
i
--)
{
int
randomIndex
=
Random
.
Range
(
1
,
i
+
1
);
Question
t
e
mp
=
array
[
i
];
Question
tmp
=
array
[
i
];
array
[
i
]
=
array
[
randomIndex
];
array
[
randomIndex
]
=
t
e
mp
;
array
[
randomIndex
]
=
tmp
;
}
}
private
void
DestroyChild
()
...
...
Assets/_project/Scripts/Systems/VFX/EffectsManager.cs
View file @
9eaf4bfd
...
...
@@ -5,6 +5,8 @@ using UnityEngine;
public
class
EffectsManager
:
MonoBehaviour
{
public
static
EffectsManager
Instance
;
[
SerializeField
]
Transform
player
;
[
SerializeField
]
ParticleSystem
correctAnswerVFX
;
[
SerializeField
]
ParticleSystem
incorrectAnswerVFX
;
...
...
@@ -19,7 +21,16 @@ public class EffectsManager : MonoBehaviour
AudioSource
_audioSource
;
Camera
_cam
;
public
static
List
<
MeshRenderer
>
_playersAndNPCsMeshRenderer
=
new
List
<
MeshRenderer
>();
private
void
Awake
()
{
if
(
Instance
==
null
)
Instance
=
this
;
else
Destroy
(
this
);
}
public
List
<
MeshRenderer
>
_playersAndNPCsMeshRenderer
=
new
List
<
MeshRenderer
>();
private
void
Start
()
{
_playersAndNPCsMeshRenderer
.
Add
(
player
.
GetComponentInChildren
<
MeshRenderer
>());
...
...
@@ -41,7 +52,7 @@ public class EffectsManager : MonoBehaviour
QuestionArea
.
OnPlayerTriggerTheQuestion
-=
PlaySFX
;
}
p
rivate
void
PlayVFX
(
bool
status
)
p
ublic
void
PlayVFX
(
bool
status
)
{
DOTween
.
To
(()
=>
curvedDefaultBendHorizontalSize
,
x
=>
{
curvedDefaultBendHorizontalSize
=
x
;
curved
.
SetBendHorizontalSize
(
x
);
},-
curvedDefaultBendHorizontalSize
,
durationCurved
...
...
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