private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { uiManege.dead(); } }
void FixedUpdate() { if (inGame) { if (!death) { if (transform.position.x < Camera.main.ScreenToWorldPoint(new Vector2(0, 0)).x) { uiManege.dead(); } if (onFloor) { animation.SetBool("floor", true); walke(); if (Input.GetKeyUp(KeyCode.A)) { rigidbody.AddForce(Vector2.up * speed * 40); onFloor = false; } } if (!onFloor) { animation.SetBool("floor", false); jump(); } } else { if (readyToDie) { dead(); } } } }