private void OnCollisionEnter2D(Collision2D other) { if (other.collider.CompareTag("Pipe")) { OnHitPipe?.Invoke(); } }
private void FixedUpdate() { CalculateRelativeForceOnBird(); rayCastObserver.CheckRayCasts(); if (gameObject.transform.position.y > screenHeight) { OnHitPipe?.Invoke(); } }
private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Score")) { OnUpdateScore?.Invoke(); } if (other.CompareTag("Pipe")) { Debug.Log(other.ToString()); OnHitPipe?.Invoke(); } }