Commit fab7144d by Naliwe GS

Added scores menu

parent a08b183d
No preview for this file type
fileFormatVersion: 2
guid: 7d2eeb02c17ea7447842a1ccbba338a9
timeCreated: 1477408964
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
...@@ -12,6 +12,8 @@ namespace Assets.Scripts.API ...@@ -12,6 +12,8 @@ namespace Assets.Scripts.API
public static string HOST_PROD = "https://quantifly.plnech.fr"; public static string HOST_PROD = "https://quantifly.plnech.fr";
public static string HOST = "http://localhost:8990"; public static string HOST = "http://localhost:8990";
public ScoresRes Scores;
public Server () public Server ()
{ {
} }
...@@ -35,8 +37,8 @@ namespace Assets.Scripts.API ...@@ -35,8 +37,8 @@ namespace Assets.Scripts.API
Debug.LogError ("Error:" + www.error); Debug.LogError ("Error:" + www.error);
} else { } else {
Debug.Log ("Got response: " + www.downloadHandler.text); Debug.Log ("Got response: " + www.downloadHandler.text);
ScoresRes res = ScoresRes.CreateFromJson (www.downloadHandler.text); Scores = ScoresRes.CreateFromJson (www.downloadHandler.text);
Debug.Log ("Got scores: " + res); Debug.Log ("Got scores: " + Scores);
} }
} }
......
...@@ -18,4 +18,9 @@ public class Menu : MonoBehaviour { ...@@ -18,4 +18,9 @@ public class Menu : MonoBehaviour {
{ {
SceneManager.LoadScene("Main"); SceneManager.LoadScene("Main");
} }
public void OnButtonScoresClicked()
{
SceneManager.LoadScene("Scores");
}
} }
...@@ -38,9 +38,7 @@ namespace Assets.Scripts ...@@ -38,9 +38,7 @@ namespace Assets.Scripts
} }
if (Progression == 25) if (Progression == 25)
{ {
if (PlayerPrefs.GetInt("highscore") < Score) Score += 200;
PlayerPrefs.SetInt("highscore", Score);
SceneManager.LoadScene("Win");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment