void EndGame() { if (Stop == true) { GameManager.EndGame(); print("endgame"); } }
void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "Enemy") { Destroy(gameObject); EndGame.Stop = true; GameManager.EndGame(); } if (other.gameObject.tag == "Fin") { player.Speed = 0; EndGame.Stop = true; Idle.SetTrigger("End"); GameManager.EndGame(); } }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Portable")) { encolere = true; GameManager.EndGame(); print("lol"); } }
IEnumerator timer() { while (time > 0) { yield return(new WaitForSeconds(1f)); time--; GetComponent <Text>().text = time.ToString(); } if (time == 0) { GameManager.EndGame(); } }
void EndGame() { GameManager.EndGame(); print("End Game"); }
void Update() { if (win >= 3) { Debug.Log("win"); GameManager.EndGame(); } if (WaitingForKey == 0) { if (QTEGen == 1) { DisplayBox.GetComponent <Text>().text = "[E]"; } if (QTEGen == 2) { DisplayBox.GetComponent <Text>().text = "[R]"; } if (QTEGen == 3) { DisplayBox.GetComponent <Text>().text = "[T]"; } if (QTEGen == 1) { if (Input.anyKeyDown && (!Input.GetKey(KeyCode.A) && !Input.GetKey(KeyCode.S))) { if (Input.GetButtonDown("E")) { CorrectKey = 1; StartCoroutine(KeyPressing()); } else { CorrectKey = 2; StartCoroutine(KeyPressing()); } } } if (QTEGen == 2) { if (Input.anyKeyDown && (!Input.GetKey(KeyCode.A) && !Input.GetKey(KeyCode.S))) { if (Input.GetButtonDown("R")) { CorrectKey = 1; StartCoroutine(KeyPressing()); } else { CorrectKey = 2; StartCoroutine(KeyPressing()); } } } if (QTEGen == 3) { if (Input.anyKeyDown && (!Input.GetKey(KeyCode.A) && !Input.GetKey(KeyCode.S))) { if (Input.GetButtonDown("T")) { CorrectKey = 1; StartCoroutine(KeyPressing()); } else { CorrectKey = 2; StartCoroutine(KeyPressing()); } } } } }