void OnTriggerEnter(Collider other) { if (other.tag == "RightBorder") { gameController.PuckIsDestroy(this); Destroy(gameObject); } else if (other.tag == "LeftBorder") { direction = getNewDirectionAfterCollision(new Vector3(0, 0, 1)); } else if (other.tag == "Stick" || other.tag == "Stick2" || other.tag == "StickOnline") { direction = getNewDirectionAfterCollision(new Vector3(0, 0, -1)); AddScore(2); getStickBoost(); gameController.hitStick(); particuleController.StickCollision(rb.position); } else if (other.tag == "TopBorder") { direction = getNewDirectionAfterCollision(new Vector3(1, 0, 0)); AddScore(1); } else if (other.tag == "BottomBorder") { direction = getNewDirectionAfterCollision(new Vector3(-1, 0, 0)); AddScore(1); } else if (other.tag == "Ball") { rb.position = position; Puck otherPuck = other.gameObject.GetComponent <Puck>(); Vector3 normal = calculateNormal(otherPuck.getDirection()); direction = getNewDirectionAfterCollision(normal); particuleController.BallCollision(position); } else if (other.tag == "Obstacle") { AddScore(5); Vector3 collisionPosition = getNewDirectionAfterCollisionWithObstacle(other.gameObject.GetComponent <Rigidbody>().position, other.bounds.size.x); particuleController.ObstacleCollision(position); } other.GetComponent <AudioSource>().volume = soundManager.sfxVolume; other.GetComponent <AudioSource>().Play(); }