Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
JogoDeCombateAsDrogas
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
william
JogoDeCombateAsDrogas
Commits
47b84fe7
Commit
47b84fe7
authored
6 years ago
by
Will
Browse files
Options
Downloads
Patches
Plain Diff
Criada classes com modificadores pra cada dificuldade
parent
12954d8a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Assets/Scripts/BasqueteMinigame/MenuManager.cs
+6
-11
6 additions, 11 deletions
Assets/Scripts/BasqueteMinigame/MenuManager.cs
Assets/Scripts/BasqueteMinigame/SettingsPersistance.cs
+73
-6
73 additions, 6 deletions
Assets/Scripts/BasqueteMinigame/SettingsPersistance.cs
with
79 additions
and
17 deletions
Assets/Scripts/BasqueteMinigame/MenuManager.cs
+
6
−
11
View file @
47b84fe7
...
...
@@ -4,8 +4,8 @@ using UnityEngine;
using
UnityEngine.SceneManagement
;
using
UnityEngine.UI
;
public
class
MenuManager
:
MonoBehaviour
{
public
class
MenuManager
:
MonoBehaviour
{
private
Text
level
;
private
Text
turnDuration
;
private
Text
maxPoints
;
...
...
@@ -31,11 +31,6 @@ public class MenuManager : MonoBehaviour {
}
}
// Update is called once per frame
void
Update
()
{
}
public
void
quit
()
{
Application
.
Quit
();
...
...
@@ -45,7 +40,7 @@ public class MenuManager : MonoBehaviour {
{
Debug
.
Log
(
SettingsPersistance
.
INSTANCE
.
turnDuration
);
Debug
.
Log
(
SettingsPersistance
.
INSTANCE
.
maxPoints
);
Debug
.
Log
(
SettingsPersistance
.
INSTANCE
.
level
);
Debug
.
Log
(
SettingsPersistance
.
INSTANCE
.
difficulty
);
SceneManager
.
LoadScene
(
scene
);
}
...
...
@@ -56,15 +51,15 @@ public class MenuManager : MonoBehaviour {
if
(
level
.
text
==
"Normal"
)
{
SettingsPersistance
.
INSTANCE
.
level
=
Level
.
n
ormal
;
SettingsPersistance
.
INSTANCE
.
difficulty
=
new
N
ormal
()
;
}
else
if
(
level
.
text
==
"Dificil"
)
{
SettingsPersistance
.
INSTANCE
.
level
=
Level
.
dific
il
;
SettingsPersistance
.
INSTANCE
.
dif
f
ic
ulty
=
new
Hard
()
;
}
else
{
SettingsPersistance
.
INSTANCE
.
level
=
Level
.
facil
;
SettingsPersistance
.
INSTANCE
.
difficulty
=
new
Easy
()
;
}
}
}
This diff is collapsed.
Click to expand it.
Assets/Scripts/BasqueteMinigame/SettingsPersistance.cs
+
73
−
6
View file @
47b84fe7
...
...
@@ -6,7 +6,7 @@ public class SettingsPersistance : MonoBehaviour
{
public
static
SettingsPersistance
INSTANCE
;
[
HideInInspector
]
public
Level
level
;
[
HideInInspector
]
public
Difficulty
difficulty
;
[
HideInInspector
]
public
int
turnDuration
;
[
HideInInspector
]
public
int
maxPoints
;
...
...
@@ -28,15 +28,82 @@ public class SettingsPersistance : MonoBehaviour
private
void
defaultValues
()
{
level
=
Level
.
facil
;
difficulty
=
new
Easy
()
;
turnDuration
=
8
;
maxPoints
=
3
;
}
}
public
enum
Level
public
abstract
class
Difficulty
{
facil
,
normal
,
dificil
protected
float
costModifier
;
protected
float
speed
;
protected
float
jumpForce
;
protected
float
force
;
protected
float
maxStamina
;
protected
float
speedModifier
;
public
float
getCostModifier
()
{
return
costModifier
;
}
public
float
getSpeed
()
{
return
speed
;
}
public
float
getJumpForce
()
{
return
jumpForce
;
}
public
float
getForce
()
{
return
force
;
}
public
float
getMaxStamina
()
{
return
maxStamina
;
}
public
float
getSpeedModifier
()
{
return
speedModifier
;
}
}
public
class
Easy
:
Difficulty
{
public
Easy
()
{
costModifier
=
1
;
speed
=
4
;
jumpForce
=
5
;
force
=
0.8f
;
maxStamina
=
20
;
speedModifier
=
2
;
}
}
public
class
Normal
:
Difficulty
{
public
Normal
()
{
costModifier
=
2
;
speed
=
3
;
jumpForce
=
4
;
force
=
0.8f
;
maxStamina
=
15
;
speedModifier
=
1.5f
;
}
}
public
class
Hard
:
Difficulty
{
public
Hard
()
{
costModifier
=
3
;
speed
=
2
;
jumpForce
=
3
;
force
=
0.5f
;
maxStamina
=
15
;
speedModifier
=
1.2f
;
}
}
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
register
or
sign in
to comment