void Start() { // Find the gameover script gameoverScript = GameObject.Find("GameOverModel").GetComponent <GameoverScript>(); // Create a new game this.NewGame(); }
void Start() { // Load and apply powerup string path = "Assets/Resources/survival.txt"; StreamReader read = new StreamReader(path); string pType = read.ReadLine(); powerType = Convert.ToInt32(pType); // Close the file read.Close(); // Find the gameover script gameoverScript = GameObject.Find("GameOverModel").GetComponent <GameoverScript>(); if (powerType == 1) { p1.gameObject.SetActive(false); bigp1.gameObject.SetActive(true); } else if (powerType == 2) { ball.gameObject.SetActive(false); large.gameObject.SetActive(true); large.type = 1; } else if (powerType == 3) { clone1.gameObject.SetActive(true); clone2.gameObject.SetActive(true); ballCount = 3; } else if (powerType == 5) { p1.type = 2; } // Create a new game this.NewGame(); }