void OnTriggerEnter2D(Collider2D other) { // if (other.tag == "Obstacle") { // Application.LoadLevel (Application.loadedLevel); // } // transform.position = spawnPoint; if (other.gameObject.tag == "Obstacle") { Debug.Log("collided with " + other.gameObject.name); if (shielded > 0) { shielded--; GameObject.Find("Shield").SetActive(false); } else { Application.LoadLevel("Death"); } } if (other.gameObject.tag == "finish") { DisplayHighScore.insert_Score(); Application.LoadLevel("Finish"); } }
void OnGUI() { string message = "Highest Score for this level: " + DisplayHighScore.return_highscore(); message = message + "\n Your current score: " + DisplayHighScore.format(DisplayTime.playtime); message = message + "\n Your total amount of coins: " + coinScript.coins; GUI.color = Color.black; GUI.Label(new Rect(400, 120, 400, 500), message); }
void Start() { m_instance = this; for (int i = 0; i < m_highscoreFieldsText.Length; i++) { m_highscoreFieldsText[i].text = i + 1 + ". Loading..."; } m_highscoresManager = GetComponent <LeaderBoard>(); RefreshHighscores(); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } displayHighScore = GetComponent <DisplayHighScore>(); Download(); }
private void Update() { countOfPlayers = GameObject.FindGameObjectsWithTag("Player").Length; if (countOfPlayers == 0 && PhotonNetwork.IsMasterClient) { m_restartUI.SetActive(true); } if (Input.GetKeyDown(KeyCode.Tab)) { DisplayHighScore.RefreshHighscores(); } if (Input.GetKey(KeyCode.Tab)) { m_leaderBoardUI.SetActive(true); } else { m_leaderBoardUI.SetActive(false); } if (Input.GetKeyDown(KeyCode.Escape)) { if (!inMenu) { m_menuUI.SetActive(true); inMenu = true; } else { m_menuUI.SetActive(false); m_settingsUI.SetActive(false); m_helpUI.SetActive(false); m_leaderBoardUI.SetActive(false); inMenu = false; } } }
private void Awake() { instance = this; highscoreDisplay = GetComponent <DisplayHighScore>(); }
void Awake() { highScoreDisplay = GetComponent <DisplayHighScore>(); //instance = this; }