// Use this for initialization
 void Start()
 {
     ws = WorldScript.getInstance();
     for (int i = 4; i >= 0; i--)
     {
         if (ws.GetScore() > ws.getHighScore(i))
         {
             place = i;
         }
     }
     ;
     score.text = "Score : " + ws.GetScore();
     input.text = "Player";
 }
示例#2
0
 // Update is called once per frame
 void Update()
 {
     obj.GetComponent <TextMesh>().text   = "SCORE: " + ws.GetScore();
     level.GetComponent <TextMesh>().text = "LEVEL " + ws.GetLevel();
     if (ws.GetKills() != 0 && ws.GetKills() % 30 == 0)
     {
         ws.ResetKills();
         Invoke("AddPrompt", 1f);
     }
 }
 public void SaveScore()
 {
     if (input.text != "")
     {
         for (int i = 4; i > place; i--)
         {
             ws.setName(i, ws.getName(i - 1));
             ws.setHighScore(i, ws.getHighScore(i - 1));
         }
         ws.setName(place, input.text);
         ws.setHighScore(place, ws.GetScore());
         SceneManager.LoadScene("Menu");
     }
 }
    // Update is called once per frame
    void Update()
    {
        float offsetX = Input.GetAxis("Submit");

        if (offsetX > 0)
        {
            if (ws.GetScore() <= ws.getHighScore(4))
            {
                SceneManager.LoadScene("Menu");
            }
            else
            {
                SceneManager.LoadScene("ScoreInput");
            }
        }
    }