// Use this for initialization void Start() { //initialise variables paused = false; audioPlaying = PlayerPrefs.GetInt ("audio"); //set button fontsize customButton = new GUIStyle("button"); customButton.fontSize = 32; //initialise rect for menu menuRect = new Rect (Screen.width / 4, 100, Screen.width / 2, Screen.height / 2); //check if audio is playing if (audioPlaying == 0) { sound = true; } else { sound = false; } //retrieve webcamscript from the web cam object webCamScript = camObject.GetComponent <webCamScript>(); }
// Start is called before the first frame update void Start() { alive = true; powered = false; wCScript = GetComponentInChildren <webCamScript>(); }
// Use this for initialization void Start() { //initialise variables spawnHealth = 0; waveNumber = 0; score = 0; gameOver = false; //retrieve high scores highScore = new int[3]; highScore[0] = PlayerPrefs.GetInt ("highScoreOne", 0); highScore [1] = PlayerPrefs.GetInt ("highScoreTwo", 0); highScore [2] = PlayerPrefs.GetInt ("highScoreThree", 0); //retrieve sound information (on/off) audioPlaying = PlayerPrefs.GetInt ("audio"); //set spawn rotation to identity quaternion Quaternion spawnRotation = Quaternion.identity; //retreieve webcamscript from game object with it attached webCamScript = camObject.GetComponent <webCamScript>(); UpdateScore (); //start coroutine of wave spawner StartCoroutine (SpawnWaves ()); }