// Update is called once per frame void Update() { if (score >= 50) { SceneManager.LoadScene("Project2", LoadSceneMode.Single); } if (gun != null) { if (Input.GetKey("z")) { gun.GetComponent <weapon>().ultmate(); } } highScore = PlayerPrefs.GetInt("highScore", highScore); if (score > highScore) { highScore = score; PlayerPrefs.SetInt("highScore", highScore); } if (counter0 == 55) { spawnEnemy0(); counter0 = 0; } if (counter1 == 150) { spawnEnemy1(); counter1 = 0; } if (playerState == 1) { if (Input.GetKeyDown("g")) { if (weaponState == 0) { weaponState = (int)WeaponType.Blaster; myweapon.vod = myweapon.shootBlaster; GameObject.FindGameObjectWithTag("Player").GetComponent <Hero>().upgradeBlasters(false); } else if (weaponState == 1) { weaponState = (int)WeaponType.Upgraded; myweapon.vod = myweapon.shootUpgraded; GameObject.FindGameObjectWithTag("Player").GetComponent <Hero>().upgradeBlasters(true); } else if (weaponState == 2) { weaponState = (int)WeaponType.Simple; myweapon.vod = myweapon.shootSimple; GameObject.FindGameObjectWithTag("Player").GetComponent <Hero>().upgradeBlasters(false); } } if (Input.GetKeyDown("x")) { myweapon.vod(); } } counter0++; counter1++; }