// Start is called before the first frame update void Start() { _highscore = PlayerPrefs.GetInt("score", 0); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; _pause_animation = pause_menu.GetComponent <Animator>(); _audio = GetComponent <AudioSource>(); _lives1 = transform.FindChild("lives1").GetComponent <Image>(); _scoretext1 = transform.FindChild("score1").GetComponent <Text>(); _spawn = GameObject.FindObjectOfType <spawn_manager>(); _pause_animation.updateMode = AnimatorUpdateMode.UnscaledTime; if (coop) { _lives2 = transform.FindChild("lives2").GetComponent <Image>(); _scoretext2 = transform.FindChild("score2").GetComponent <Text>(); } else { _highscoretext = transform.FindChild("highscore").GetComponent <Text>(); } }
void Start() { Debug.Log("Game Has Started"); spawn_manager = GameObject.Find("spawn_manager").GetComponent <spawn_manager>(); wave = GameObject.Find("wave").GetComponent <Wave>(); UI_Manager = GameObject.Find("Canvas").GetComponent <UI_Manager>(); if (spawn_manager == null) { Debug.LogError("Spawn Manager Not Found"); } if (UI_Manager == null) { Debug.LogError("UI Canvas Not Found"); } }
// Start is called before the first frame update void Start() { _spawn_Manager = GameObject.Find("spawn_manager").GetComponent <spawn_manager>(); }