void OnCollisionEnter(Collision collision) { if (collision.gameObject.name == "CameraObject") { deathComponent.OnDeath(); } }
void OnCollisionEnter(Collision other) { deathComponent.OnDeath(); /* if (other.gameObject.GetComponent<Death>()) { * Canvas gameOverCanvas = other.gameObject.GetComponentInChildren<Canvas> (true); * if (gameOverCanvas) { * gameOverCanvas.gameObject.SetActive (true); * } * } */ }
// Update is called once per frame void Update() { isGrounded = groudingCounter > 0; if (isGrounded) { jumpCounter = 0; } if (Input.GetButtonDown("Fire1") && jumpCounter < jumpModifiers.Length) { Jump(jumpModifiers[jumpCounter]); playerAudio.PlayJumpSound(); jumpCounter++; } if (transform.position.y < 0) { deathComponent.OnDeath(); } }
void OnCollisionEnter(Collision collision) { deathComponent.OnDeath(); }