Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions unity/Tiled2Unity/Scripts/Editor/ImportTiled2Unity.Prefab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#if !UNITY_WEBPLAYER
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -375,8 +376,8 @@ private void AddCollidersTo(GameObject gameObject, bool isTrigger, XElement xml)
// 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])
let x = Convert.ToSingle(pt.Split(',')[0], CultureInfo.InvariantCulture)
let y = Convert.ToSingle(pt.Split(',')[1], CultureInfo.InvariantCulture)
select new Vector2(x, y);

collider.points = points.ToArray();
Expand Down Expand Up @@ -416,8 +417,8 @@ private void AddCollidersTo(GameObject gameObject, bool isTrigger, XElement xml)
// 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])
let x = Convert.ToSingle(pt.Split(',')[0], CultureInfo.InvariantCulture)
let y = Convert.ToSingle(pt.Split(',')[1], CultureInfo.InvariantCulture)
#if T2U_IS_UNITY_4
// Hack for Unity 4.x
select new Vector2(x + offset_x, y + offset_y);
Expand Down