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
0c2029b6
Unverified
Commit
0c2029b6
authored
Oct 27, 2016
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Server: PostScore
parent
0fa7e1df
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
14 deletions
+3
-14
Main.unity
Assets/Scenes/Main.unity
+0
-0
Server.cs
Assets/Scripts/API/Server.cs
+2
-12
Player.cs
Assets/Scripts/Player.cs
+1
-2
No files found.
Assets/Scenes/Main.unity
View file @
0c2029b6
No preview for this file type
Assets/Scripts/API/Server.cs
View file @
0c2029b6
...
@@ -41,23 +41,13 @@ namespace Assets.Scripts.API
...
@@ -41,23 +41,13 @@ namespace Assets.Scripts.API
}
}
}
}
public
void
PostScore
(
int
score
,
String
playerName
,
String
playerTeam
=
null
)
public
static
void
PostScore
(
int
score
,
String
playerName
,
String
playerTeam
=
null
)
{
{
//TODO (Fixme) How can I use Server.PostScore()
StartCoroutine
(
PushScoreAsync
(
score
,
playerName
,
playerTeam
));
}
IEnumerator
PushScoreAsync
(
int
score
,
String
playerName
,
String
playerTeam
)
{
WWWForm
form
=
new
WWWForm
();
WWWForm
form
=
new
WWWForm
();
form
.
AddField
(
"name"
,
playerName
);
form
.
AddField
(
"name"
,
playerName
);
form
.
AddField
(
"team"
,
playerTeam
);
form
.
AddField
(
"team"
,
playerTeam
);
form
.
AddField
(
"score"
,
score
);
form
.
AddField
(
"score"
,
score
);
WWW
www
=
new
WWW
(
HOST_PROD
+
"/score/"
,
form
);
WWW
w
=
new
WWW
(
HOST_DEV
+
"/score/"
,
form
);
yield
return
w
;
if
(!
string
.
IsNullOrEmpty
(
w
.
error
))
{
print
(
w
.
error
);
}
}
}
[
Serializable
]
[
Serializable
]
...
...
Assets/Scripts/Player.cs
View file @
0c2029b6
...
@@ -34,9 +34,8 @@ namespace Assets.Scripts
...
@@ -34,9 +34,8 @@ namespace Assets.Scripts
{
{
if
(
PlayerPrefs
.
GetInt
(
"highscore"
)
<
Score
)
if
(
PlayerPrefs
.
GetInt
(
"highscore"
)
<
Score
)
PlayerPrefs
.
SetInt
(
"highscore"
,
Score
);
PlayerPrefs
.
SetInt
(
"highscore"
,
Score
);
Server
server
=
GetComponent
(
typeof
(
Server
))
as
Server
;
server
.
PostScore
(
Score
,
"PLN"
,
"iGEM IONIS"
);
SceneManager
.
LoadScene
(
"GameOver"
);
SceneManager
.
LoadScene
(
"GameOver"
);
}
}
if
(
Progression
==
25
)
if
(
Progression
==
25
)
{
{
...
...
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