Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
igem-quantifly
Overview
Overview
Details
Activity
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
PLN
igem-quantifly
Commits
e7c718ed
Unverified
Commit
e7c718ed
authored
Oct 28, 2016
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Score: Submit on GameOver
parent
967ec03e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
GameOver.unity
Assets/Scenes/GameOver.unity
+0
-0
GameOver.cs
Assets/Scripts/GameOver.cs
+7
-6
Player.cs
Assets/Scripts/Player.cs
+1
-0
No files found.
Assets/Scenes/GameOver.unity
View file @
e7c718ed
No preview for this file type
Assets/Scripts/GameOver.cs
View file @
e7c718ed
...
...
@@ -8,18 +8,17 @@ using Assets.Scripts.API;
public
class
GameOver
:
MonoBehaviour
{
private
float
_timer
=
0f
;
private
int
score
;
private
int
score
=
0
;
private
Player
_player
;
private
GameObject
_player
;
public
InputField
PlayerName
;
public
InputField
TeamName
;
public
Text
Score
;
public
Button
buttonSubmit
;
public
Button
buttonPlay
;
void
Start
()
{
_player
=
GameObject
.
FindWithTag
(
"Player"
).
GetComponent
<
Player
>();
score
=
_player
.
Score
;
Score
.
text
=
"You scored "
+
score
;
}
void
Update
()
...
...
@@ -27,6 +26,8 @@ public class GameOver : MonoBehaviour
// _timer += Time.deltaTime;
// if (_timer > 4f)
// SceneManager.LoadScene("Menu");
score
=
PlayerPrefs
.
GetInt
(
"lastscore"
);
Score
.
text
=
"You scored "
+
score
;
}
public
void
OnButtonPlayClicked
()
...
...
@@ -40,7 +41,7 @@ public class GameOver : MonoBehaviour
if
(
playerText
==
null
||
playerText
.
Length
==
0
)
{
playerText
=
"Random Randy"
;
}
string
teamText
=
Player
Name
.
text
;
string
teamText
=
Team
Name
.
text
;
if
(
teamText
==
null
||
teamText
.
Length
==
0
)
{
teamText
=
null
;
}
...
...
Assets/Scripts/Player.cs
View file @
e7c718ed
...
...
@@ -34,6 +34,7 @@ namespace Assets.Scripts
{
if
(
PlayerPrefs
.
GetInt
(
"highscore"
)
<
Score
)
PlayerPrefs
.
SetInt
(
"highscore"
,
Score
);
PlayerPrefs
.
SetInt
(
"lastscore"
,
Score
);
SceneManager
.
LoadScene
(
"GameOver"
);
}
...
...
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