diff --git a/Assets/IsoTools/Scripts/IsoObject.cs b/Assets/IsoTools/Scripts/IsoObject.cs index 9430c17..fd3d216 100644 --- a/Assets/IsoTools/Scripts/IsoObject.cs +++ b/Assets/IsoTools/Scripts/IsoObject.cs @@ -80,6 +80,15 @@ public class IsoObject : MonoBehaviour { } } + public Vector3 TilePosition { + get { + return new Vector3( + Mathf.Round(Position.x), + Mathf.Round(Position.y), + Mathf.Round(Position.z)); + } + } + IsoWorld _iso_world = null; public IsoWorld GetIsoWorld() { if ( !_iso_world ) { @@ -96,10 +105,7 @@ public class IsoObject : MonoBehaviour { } public void FixAlignment() { - _position.Set( - Mathf.Round(_position.x), - Mathf.Round(_position.y), - Mathf.Round(_position.z)); + _position = TilePosition; FixTransform(); MartDirtyIsoWorld(); if ( Application.isEditor ) { diff --git a/UnityIso-csharp.sln b/UnityIso-csharp.sln index 94bdbb6..9a77d46 100644 --- a/UnityIso-csharp.sln +++ b/UnityIso-csharp.sln @@ -17,7 +17,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution + GlobalSection(MonoDevelopProperties) = preSolution StartupItem = Assembly-CSharp.csproj Policies = $0 $0.TextStylePolicy = $1 diff --git a/UnityIso.sln b/UnityIso.sln index 529e0f0..e2c808e 100644 --- a/UnityIso.sln +++ b/UnityIso.sln @@ -17,7 +17,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution + GlobalSection(MonoDevelopProperties) = preSolution StartupItem = Assembly-CSharp.csproj Policies = $0 $0.TextStylePolicy = $1