// This is for collide to balloon // It loops to monitor all balloons in game // and all it's balloon part of points // if intersect // call balloon's destroy method void CollisionWithBalloon() { balloon_list = FindObjectsOfType <Balloon>(); for (int i = 0; i < balloon_list.Length; i++) { Balloon ballon = balloon_list[i].GetComponent <Balloon>(); for (int j = 0; j < ballon.points.Count - 4; j++) { float distance = Mathf.Sqrt(Mathf.Pow(ballon.points[j].x + ballon.initiate_point.x - transform.position.x, 2) + Mathf.Pow(ballon.points[j].y + ballon.initiate_point.y - transform.position.y, 2)); if (distance <= radius) { ballon.DestroyB(); } } } }