void Start() { loseSript = GameObject.Find("LoseSceneController").GetComponent <LoseScript> (); //originalColor = Camera.main.backgroundColor; scoreCounter = GameObject.Find("ScoreCounter").GetComponent <ScoreCounter> (); Fruits = GameObject.Find("SceneController").GetComponent <SpawnContoller> (); timeController = GameObject.Find("SceneController").GetComponent <TimeController> (); pauseButton = GameObject.Find("UIController").GetComponent <PauseButton> (); }
private void Start() { try { m_LevelScore = GameObject.FindGameObjectWithTag("LevelScore").GetComponent <LevelScore>(); } catch (NullReferenceException ex) { Debug.LogWarning("Score Manager not found > " + ex.Message); } m_DialogManager = GameObject.Find("DialogManager").GetComponent <DialogManager>(); m_Lose = gameObject.GetComponent <LoseScript>(); }
public void Hurt(int damage) { _health -= damage; ll.LifeProp = _health; Debug.Log("Health: " + _health); if (_health == 0) { //Time.timeScale = 0; LoseScript ls = GetComponent <LoseScript>(); ls.ShowText(true); //yield return new WaitForSeconds(0); Cursor.lockState = CursorLockMode.None; Cursor.visible = true; SceneManager.LoadScene("Menu"); } }