Ejemplo n.º 1
0
    public void SubmitButton()
    {
        btnAudio.Play();
        username = usernameText.text;

        if (CheckConnection("http://www.google.com"))
        {
            if (string.IsNullOrEmpty(username))
            {
                Debug.Log("Please enter username");
                usernameInput.GetComponentInChildren <Text>().text = "Please enter username";
            }
            else
            {
                //username.ToLower();
                HighScoreDreamlo.AddNewHighScore(username, Score);
                usernameInput.SetActive(false);
                gameOverText.text = "Game Over \nPress Screen to Restart";
                IsScreenDisable   = false;
            }
        }
        else
        {
            usernameInput.GetComponentInChildren <Text>().text = "No internet connection";
            usernameInput.SetActive(false);
            gameOverText.text = "Game Over \nPress Screen to Restart";
            IsScreenDisable   = false;
        }
    }
 void Awake()
 {
     instance          = this;
     highscoresDisplay = GetComponent <DisplayHighScoresOnline>();
     //AddNewHighScore("GM", 1000);
     //AddNewHighScore("Pepe", 100);
     //AddNewHighScore("Pepito", 200);
     DownloadHighScores();
 }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     for (int i = 0; i < highScoreText.Length; i++)
     {
         highScoreText[i].text = i + 1 + ". Fetching...";
     }
     highscoreManager = GetComponent <HighScoreDreamlo>();
     StartCoroutine("RefreshHighScores");
 }
Ejemplo n.º 4
0
        void Start()
        {
            if (PlayerPrefs.GetInt("MuteSound") == 1)
            {
                btnAudio.enabled = false;
            }
            else
            {
                btnAudio.enabled = true;
            }

            highscoreManager = GameObject.FindObjectOfType(typeof(HighScoreDreamlo)) as HighScoreDreamlo;
            gsList.Clear();
            SetScrollBarVisibility(false);
            StartCoroutine(AddItem());
            StartCoroutine("RefreshHighScores");
        }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        //gameOver = false;

        hazardCount     = 10;
        Score           = 0;
        isStartGame     = false;
        IsScreenDisable = true;
        gameOverText.gameObject.gameObject.SetActive(false);
        highscoreManager = GameObject.FindObjectOfType(typeof(HighScoreDreamlo)) as HighScoreDreamlo;


        if (PlayerPrefs.GetInt("MuteSound") == 1)
        {
            btnMute.image.sprite = muteSprites[1];
            MuteSound();
        }

        if (PlayerPrefs.GetInt("GamePaused") == 1)
        {
            Score          = PlayerPrefs.GetInt("ScorePaused");
            scoreText.text = "Score: " + PlayerPrefs.GetInt("ScorePaused");
        }
        else
        {
            UpdateScore();
        }

        if (!StartGame)
        {
            gameOverText.text = "";
        }
        else
        {
            StartCoroutine(SpawnWaves());
        }
        if (music.audio.isPlaying)
        {
            music.audio.Stop();
        }
    }