private void AddCollidersTo(GameObject gameObject, bool isTrigger, XElement xml)
        {
            // Box colliders
            foreach (XElement xmlBoxCollider2D in xml.Elements("BoxCollider2D"))
            {
                BoxCollider2D collider = gameObject.AddComponent <BoxCollider2D>();
                collider.isTrigger = isTrigger;
                float width  = ImportUtils.GetAttributeAsFloat(xmlBoxCollider2D, "width");
                float height = ImportUtils.GetAttributeAsFloat(xmlBoxCollider2D, "height");
                collider.size   = new Vector2(width, height);
                collider.offset = new Vector2(width * 0.5f, -height * 0.5f);

                ImportUtils.ApplyColliderOffset(xmlBoxCollider2D, collider);
            }

            // Circle colliders
            foreach (XElement xmlCircleCollider2D in xml.Elements("CircleCollider2D"))
            {
                CircleCollider2D collider = gameObject.AddComponent <CircleCollider2D>();
                collider.isTrigger = isTrigger;
                float radius = ImportUtils.GetAttributeAsFloat(xmlCircleCollider2D, "radius");
                collider.radius = radius;
                collider.offset = new Vector2(radius, -radius);

                ImportUtils.ApplyColliderOffset(xmlCircleCollider2D, collider);
            }

            // Edge colliders
            foreach (XElement xmlEdgeCollider2D in xml.Elements("EdgeCollider2D"))
            {
                EdgeCollider2D collider = gameObject.AddComponent <EdgeCollider2D>();
                collider.isTrigger = isTrigger;
                string data = xmlEdgeCollider2D.Element("Points").Value;

                // The data looks like this:
                //  x0,y0 x1,y1 x2,y2 ...
                var points = from pt in data.Split(' ')
                             let x                 = Convert.ToSingle(pt.Split(',')[0])
                                             let y = Convert.ToSingle(pt.Split(',')[1])
                                                     select new Vector2(x, y);

                collider.points = points.ToArray();

                ImportUtils.ApplyColliderOffset(xmlEdgeCollider2D, collider);
            }

            // Polygon colliders
            foreach (XElement xmlPolygonCollider2D in xml.Elements("PolygonCollider2D"))
            {
                PolygonCollider2D collider = gameObject.AddComponent <PolygonCollider2D>();
                collider.isTrigger = isTrigger;

                var paths = xmlPolygonCollider2D.Elements("Path").ToArray();
                collider.pathCount = paths.Count();

                for (int p = 0; p < collider.pathCount; ++p)
                {
                    string data = paths[p].Value;

                    // The data looks like this:
                    //  x0,y0 x1,y1 x2,y2 ...
                    var points = from pt in data.Split(' ')
                                 let x                 = Convert.ToSingle(pt.Split(',')[0])
                                                 let y = Convert.ToSingle(pt.Split(',')[1])
                                                         select new Vector2(x, y);

                    collider.SetPath(p, points.ToArray());
                }

                ImportUtils.ApplyColliderOffset(xmlPolygonCollider2D, collider);
            }
        }