// Use this for initialization void Start() { m_Player = FindObjectOfType <SpaceShip_Controller>(); m_HUD = FindObjectOfType <Player_HUD>(); m_Spawners = FindObjectsOfType <Spawn_Controller>(); m_Values = FindObjectOfType <ValueHolder> (); m_HighScores = new ScoreTable(); m_HighScores.LoadScores(); m_Timer = m_Respawn; }
private void Start() { ScoreTable.LoadScores(); GameStatus.Load(ScoreTable.currentPlayer); rb = gameObject.GetComponent <Rigidbody>(); cam = GameObject.FindGameObjectWithTag("TopDown").GetComponent <Camera>(); stats = gameObject.GetComponent <CharacterStats>(); GameStatus.theGameIsOn = true; currentHealth = stats.maxHealth; currentMana = stats.maxMana; Time.timeScale = 1; swordCdReady = true; axeCdReady = true; spellCdReady = true; isDead = false; GameStatus.inLevel = true; }
public void StartGame() { if (textField.text.Length > 0 && !PlayerPrefs.HasKey(textField.text)) { GameStatus.gameBegin = true; PlayerPrefs.SetString(textField.text, textField.text); PlayerPrefs.SetInt(textField.text + "levels", 1); PlayerPrefs.SetInt(textField.text + "scores", 0); //testing ways to do highscore ScoreTable.SetScore(textField.text, "level", 1); ScoreTable.SetScore(textField.text, "score", 0); ScoreTable.currentPlayer = textField.text; ScoreTable.SaveScores(); Debug.Log("New Challenger! Name: " + textField.text + " Level: " + ScoreTable.GetScore(textField.text, "level") + ", Score: " + ScoreTable.GetScore(textField.text, "score")); SceneManager.LoadScene("Map"); } else if (PlayerPrefs.HasKey(textField.text)) { ScoreTable.currentPlayer = textField.text; Debug.Log(PlayerPrefs.GetString(textField.text)); ScoreTable.LoadScores(); SceneManager.LoadScene("Map"); } }
// Use this for initialization void Start() { m_Player = FindObjectOfType<SpaceShip_Controller>(); m_HUD = FindObjectOfType<Player_HUD>(); m_Spawners = FindObjectsOfType<Spawn_Controller>(); m_Values = FindObjectOfType<ValueHolder> (); m_HighScores = new ScoreTable(); m_HighScores.LoadScores (); m_Timer = m_Respawn; }