Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IF3210-2024-Unity-DOR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Leon Putra Widhi
IF3210-2024-Unity-DOR
Commits
080fde2d
Commit
080fde2d
authored
May 8, 2024
by
Bill Clinton
Browse files
Options
Downloads
Plain Diff
Merge branch 'feat/cheats-and-orbs' into 'main'
Refactor Motherlode Cheat See merge request
!24
parents
b8f90229
15d6657d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!24
Refactor Motherlode Cheat
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Assets/Scripts/Managers/CheatManager.cs
+2
-4
2 additions, 4 deletions
Assets/Scripts/Managers/CheatManager.cs
Assets/Scripts/Player/PlayerCurrency.cs
+12
-0
12 additions, 0 deletions
Assets/Scripts/Player/PlayerCurrency.cs
with
14 additions
and
4 deletions
Assets/Scripts/Managers/CheatManager.cs
+
2
−
4
View file @
080fde2d
...
@@ -48,7 +48,6 @@ public class CheatManager : MonoBehaviour
...
@@ -48,7 +48,6 @@ public class CheatManager : MonoBehaviour
string
textInput
;
string
textInput
;
public
InputField
inputField
;
public
InputField
inputField
;
int
prevBalance
;
bool
[]
cheats
=
new
bool
[
3
];
bool
[]
cheats
=
new
bool
[
3
];
...
@@ -165,8 +164,7 @@ public class CheatManager : MonoBehaviour
...
@@ -165,8 +164,7 @@ public class CheatManager : MonoBehaviour
private
void
ActivateMotherlode
()
private
void
ActivateMotherlode
()
{
{
prevBalance
=
playerCurrency
.
balance
;
playerCurrency
.
ActivateMotherlode
();
playerCurrency
.
balance
=
100000
;
hud
.
OpenPanel
(
"Motherlode Cheat Activated!"
);
hud
.
OpenPanel
(
"Motherlode Cheat Activated!"
);
}
}
...
@@ -253,7 +251,7 @@ public class CheatManager : MonoBehaviour
...
@@ -253,7 +251,7 @@ public class CheatManager : MonoBehaviour
private
void
ActivateReset
()
private
void
ActivateReset
()
{
{
playerHealth
.
SetCheatNoDamage
(
false
);
playerHealth
.
SetCheatNoDamage
(
false
);
playerCurrency
.
balance
=
prevBalance
;
playerCurrency
.
ResetMotherlode
()
;
playerMovement
.
ResetSpeed
();
playerMovement
.
ResetSpeed
();
playerShooting
.
ResetPlayerDamage
();
playerShooting
.
ResetPlayerDamage
();
...
...
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/Player/PlayerCurrency.cs
+
12
−
0
View file @
080fde2d
...
@@ -6,6 +6,7 @@ using UnityEngine;
...
@@ -6,6 +6,7 @@ using UnityEngine;
public
class
PlayerCurrency
:
MonoBehaviour
public
class
PlayerCurrency
:
MonoBehaviour
{
{
public
int
balance
=
0
;
public
int
balance
=
0
;
int
prevBalance
;
// Start is called before the first frame update
// Start is called before the first frame update
public
void
add
(
int
nominal
)
public
void
add
(
int
nominal
)
...
@@ -28,4 +29,15 @@ public class PlayerCurrency : MonoBehaviour
...
@@ -28,4 +29,15 @@ public class PlayerCurrency : MonoBehaviour
{
{
return
balance
;
return
balance
;
}
}
public
void
ActivateMotherlode
()
{
prevBalance
=
balance
;
balance
=
100000
;
}
public
void
ResetMotherlode
()
{
balance
=
prevBalance
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment