Пример #1
0
 private void OnCollisionEnter2D(Collision2D other)
 {
     if (other.collider.CompareTag("Pipe"))
     {
         OnHitPipe?.Invoke();
     }
 }
Пример #2
0
 private void FixedUpdate()
 {
     CalculateRelativeForceOnBird();
     rayCastObserver.CheckRayCasts();
     if (gameObject.transform.position.y > screenHeight)
     {
         OnHitPipe?.Invoke();
     }
 }
Пример #3
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Score"))
     {
         OnUpdateScore?.Invoke();
     }
     if (other.CompareTag("Pipe"))
     {
         Debug.Log(other.ToString());
         OnHitPipe?.Invoke();
     }
 }