Browse Source

[csharp] Format all source code using formatters/.editorconfig

Mario Zechner 3 năm trước cách đây
mục cha
commit
d12b15ca8d
100 tập tin đã thay đổi với 1093 bổ sung1177 xóa
  1. 4 4
      spine-csharp/src/Animation.cs
  2. 12 12
      spine-csharp/src/AnimationState.cs
  3. 1 1
      spine-csharp/src/Atlas.cs
  4. 1 1
      spine-csharp/src/Attachments/AtlasAttachmentLoader.cs
  5. 1 1
      spine-csharp/src/Attachments/ClippingAttachment.cs
  6. 1 1
      spine-csharp/src/Attachments/MeshAttachment.cs
  7. 1 2
      spine-csharp/src/ConstraintData.cs
  8. 1 1
      spine-csharp/src/ExposedList.cs
  9. 26 26
      spine-csharp/src/IkConstraint.cs
  10. 56 70
      spine-csharp/src/Json.cs
  11. 12 12
      spine-csharp/src/MathUtils.cs
  12. 3 3
      spine-csharp/src/PathConstraint.cs
  13. 4 4
      spine-csharp/src/Skeleton.cs
  14. 225 226
      spine-csharp/src/SkeletonBinary.cs
  15. 1 1
      spine-csharp/src/SkeletonData.cs
  16. 78 78
      spine-csharp/src/SkeletonJson.cs
  17. 1 1
      spine-csharp/src/SkeletonLoader.cs
  18. 2 2
      spine-csharp/src/Slot.cs
  19. 1 1
      spine-csharp/src/SlotData.cs
  20. 1 1
      spine-csharp/src/TransformConstraint.cs
  21. 16 16
      spine-monogame/example/ExampleGame.cs
  22. 7 7
      spine-monogame/example/ExampleProgram.cs
  23. 4 6
      spine-unity/Assets/Spine Examples/Other Examples/Animation Tester/SpineAnimationTesterTool.cs
  24. 1 1
      spine-unity/Assets/Spine Examples/Scripts/AttackSpineboy.cs
  25. 4 4
      spine-unity/Assets/Spine Examples/Scripts/FootSoldierExample.cs
  26. 24 24
      spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/BasicPlatformerController.cs
  27. 2 2
      spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/Raptor.cs
  28. 3 3
      spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineBeginnerTwo.cs
  29. 2 2
      spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineBlinkPlayer.cs
  30. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyBeginnerInput.cs
  31. 4 4
      spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyBeginnerModel.cs
  32. 3 3
      spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyBeginnerView.cs
  33. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyTargetController.cs
  34. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Goblins.cs
  35. 2 2
      spine-unity/Assets/Spine Examples/Scripts/HurtFlashEffect.cs
  36. 2 3
      spine-unity/Assets/Spine Examples/Scripts/MecanimAnimationMatchModifier/AnimationMatchModifierAsset.cs
  37. 2 3
      spine-unity/Assets/Spine Examples/Scripts/Mix and Match Character Customize/EquipSystemExample.cs
  38. 2 3
      spine-unity/Assets/Spine Examples/Scripts/Mix and Match Character Customize/EquipsVisualsComponentExample.cs
  39. 2 2
      spine-unity/Assets/Spine Examples/Scripts/Mix and Match Character Customize/MixAndMatchSkinsButtonExample.cs
  40. 17 17
      spine-unity/Assets/Spine Examples/Scripts/Mix and Match Character Customize/MixAndMatchSkinsExample.cs
  41. 1 1
      spine-unity/Assets/Spine Examples/Scripts/MixAndMatch.cs
  42. 1 1
      spine-unity/Assets/Spine Examples/Scripts/MixAndMatchGraphic.cs
  43. 3 3
      spine-unity/Assets/Spine Examples/Scripts/RaggedySpineboy.cs
  44. 4 4
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/BoneLocalOverride.cs
  45. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/CombinedSkin.cs
  46. 2 2
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/Ghost/SkeletonGhost.cs
  47. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/Ghost/SkeletonGhostRenderer.cs
  48. 2 2
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/Legacy/AtlasRegionAttacher.cs
  49. 4 4
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/Legacy/SpriteAttacher.cs
  50. 4 4
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/OutlineSkeletonGraphic.cs
  51. 6 7
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/RenderExistingMesh.cs
  52. 3 3
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/RootMotionDeltaCompensation.cs
  53. 1 2
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SetRigidbodySolverIterations.cs
  54. 2 3
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonAnimationMulti/SkeletonAnimationMulti.cs
  55. 4 4
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonColorInitialize.cs
  56. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonGraphicPlayAnimationAtEvent.cs
  57. 2 2
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/Editor/SkeletonRagdoll2DInspector.cs
  58. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/Editor/SkeletonRagdollInspector.cs
  59. 2 2
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/SkeletonRagdoll.cs
  60. 7 7
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/SkeletonRagdoll2D.cs
  61. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/SkeletonUtilityEyeConstraint.cs
  62. 3 3
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/SkeletonUtilityGroundConstraint.cs
  63. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/SkeletonUtilityKinematicShadow.cs
  64. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SlotTintBlackFollower.cs
  65. 1 1
      spine-unity/Assets/Spine Examples/Scripts/Sample Components/SpineEventUnityHandler.cs
  66. 2 2
      spine-unity/Assets/Spine Examples/Scripts/SpawnFromSkeletonDataExample.cs
  67. 2 2
      spine-unity/Assets/Spine Examples/Scripts/SpineGauge.cs
  68. 3 3
      spine-unity/Assets/Spine Examples/Scripts/Spineboy.cs
  69. 1 1
      spine-unity/Assets/Spine Examples/Scripts/SpineboyFacialExpression.cs
  70. 4 5
      spine-unity/Assets/Spine Examples/Scripts/SpineboyFootplanter.cs
  71. 2 3
      spine-unity/Assets/Spine Examples/Scripts/SpineboyPole.cs
  72. 2 3
      spine-unity/Assets/Spine Examples/Scripts/SpineboyPoleGraphic.cs
  73. 3 4
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/AnimationReferenceAssetEditor.cs
  74. 50 52
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs
  75. 18 18
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineAtlasAssetInspector.cs
  76. 1 1
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineSpriteAtlasAssetInspector.cs
  77. 4 4
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerGraphicInspector.cs
  78. 2 2
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerInspector.cs
  79. 7 7
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerGraphicInspector.cs
  80. 7 7
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerInspector.cs
  81. 1 1
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonAnimationInspector.cs
  82. 1 1
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicCustomMaterialsInspector.cs
  83. 11 15
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicInspector.cs
  84. 3 3
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererCustomMaterialsInspector.cs
  85. 23 24
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererInspector.cs
  86. 10 11
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityBoneInspector.cs
  87. 10 11
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityInspector.cs
  88. 7 12
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs
  89. 72 89
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineSpriteShaderGUI.cs
  90. 14 14
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineAttributeDrawers.cs
  91. 108 115
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs
  92. 25 30
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/BlendModeMaterialsUtility.cs
  93. 7 10
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/BuildSettings.cs
  94. 7 7
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/DataReloadHandler.cs
  95. 4 4
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/Icons.cs
  96. 5 6
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/Instantiation.cs
  97. 14 14
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs
  98. 7 12
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineBuildProcessor.cs
  99. 27 31
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs
  100. 38 38
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineHandles.cs

+ 4 - 4
spine-csharp/src/Animation.cs

@@ -442,7 +442,7 @@ namespace Spine {
 		/// <param name="bezierCount">The maximum number of Bezier curves. See <see cref="Shrink(int)"/>.</param>
 		/// <param name="bezierCount">The maximum number of Bezier curves. See <see cref="Shrink(int)"/>.</param>
 		/// <param name="propertyIds">Unique identifiers for the properties the timeline modifies.</param>
 		/// <param name="propertyIds">Unique identifiers for the properties the timeline modifies.</param>
 		public CurveTimeline2 (int frameCount, int bezierCount, string propertyId1, string propertyId2)
 		public CurveTimeline2 (int frameCount, int bezierCount, string propertyId1, string propertyId2)
-			:base (frameCount, bezierCount, propertyId1, propertyId2) {
+			: base(frameCount, bezierCount, propertyId1, propertyId2) {
 		}
 		}
 
 
 		public override int FrameEntries {
 		public override int FrameEntries {
@@ -515,7 +515,7 @@ namespace Spine {
 		public TranslateTimeline (int frameCount, int bezierCount, int boneIndex)
 		public TranslateTimeline (int frameCount, int bezierCount, int boneIndex)
 			: base(frameCount, bezierCount, //
 			: base(frameCount, bezierCount, //
 				(int)Property.X + "|" + boneIndex, //
 				(int)Property.X + "|" + boneIndex, //
-				(int) Property.Y + "|" + boneIndex) {
+				(int)Property.Y + "|" + boneIndex) {
 			this.boneIndex = boneIndex;
 			this.boneIndex = boneIndex;
 		}
 		}
 
 
@@ -2077,7 +2077,7 @@ namespace Spine {
 		/// <param name="frame">Between 0 and <code>frameCount</code>, inclusive.</param>
 		/// <param name="frame">Between 0 and <code>frameCount</code>, inclusive.</param>
 		public void SetFrame (int frame, Event e) {
 		public void SetFrame (int frame, Event e) {
 			frames[frame] = e.time;
 			frames[frame] = e.time;
-			events [frame] = e;
+			events[frame] = e;
 		}
 		}
 
 
 		/// <summary>Fires events for frames &gt; <code>lastTime</code> and &lt;= <code>time</code>.</summary>
 		/// <summary>Fires events for frames &gt; <code>lastTime</code> and &lt;= <code>time</code>.</summary>
@@ -2411,7 +2411,7 @@ namespace Spine {
 		readonly int pathConstraintIndex;
 		readonly int pathConstraintIndex;
 
 
 		public PathConstraintPositionTimeline (int frameCount, int bezierCount, int pathConstraintIndex)
 		public PathConstraintPositionTimeline (int frameCount, int bezierCount, int pathConstraintIndex)
-			:base(frameCount, bezierCount, (int)Property.PathConstraintPosition + "|" + pathConstraintIndex) {
+			: base(frameCount, bezierCount, (int)Property.PathConstraintPosition + "|" + pathConstraintIndex) {
 			this.pathConstraintIndex = pathConstraintIndex;
 			this.pathConstraintIndex = pathConstraintIndex;
 		}
 		}
 
 

+ 12 - 12
spine-csharp/src/AnimationState.cs

@@ -73,7 +73,7 @@ namespace Spine {
 		/// out position.
 		/// out position.
 		internal const int HoldMix = 4;
 		internal const int HoldMix = 4;
 
 
-		internal const int Setup = 1,  Current = 2;
+		internal const int Setup = 1, Current = 2;
 
 
 		protected AnimationStateData data;
 		protected AnimationStateData data;
 		private readonly ExposedList<TrackEntry> tracks = new ExposedList<TrackEntry>();
 		private readonly ExposedList<TrackEntry> tracks = new ExposedList<TrackEntry>();
@@ -510,15 +510,15 @@ namespace Spine {
 			float r1, r2;
 			float r1, r2;
 			if (time < frames[0]) { // Time is before first frame.
 			if (time < frames[0]) { // Time is before first frame.
 				switch (blend) {
 				switch (blend) {
-					case MixBlend.Setup:
-						bone.rotation = bone.data.rotation;
-						goto default; // Fall through.
-					default:
-						return;
-					case MixBlend.First:
-						r1 = bone.rotation;
-						r2 = bone.data.rotation;
-						break;
+				case MixBlend.Setup:
+					bone.rotation = bone.data.rotation;
+					goto default; // Fall through.
+				default:
+					return;
+				case MixBlend.First:
+					r1 = bone.rotation;
+					r2 = bone.data.rotation;
+					break;
 				}
 				}
 			} else {
 			} else {
 				r1 = blend == MixBlend.Setup ? bone.data.rotation : bone.rotation;
 				r1 = blend == MixBlend.Setup ? bone.data.rotation : bone.rotation;
@@ -590,7 +590,7 @@ namespace Spine {
 		/// <para>
 		/// <para>
 		/// It may be desired to use <see cref="AnimationState.SetEmptyAnimations(float)"/> to mix the skeletons back to the setup pose,
 		/// It may be desired to use <see cref="AnimationState.SetEmptyAnimations(float)"/> to mix the skeletons back to the setup pose,
 		/// rather than leaving them in their current pose.</para>
 		/// rather than leaving them in their current pose.</para>
-		 /// </summary>
+		/// </summary>
 		public void ClearTracks () {
 		public void ClearTracks () {
 			bool oldDrainDisabled = queue.drainDisabled;
 			bool oldDrainDisabled = queue.drainDisabled;
 			queue.drainDisabled = true;
 			queue.drainDisabled = true;
@@ -896,7 +896,7 @@ namespace Spine {
 					}
 					}
 					timelineMode[i] = AnimationState.HoldFirst;
 					timelineMode[i] = AnimationState.HoldFirst;
 				}
 				}
-				continue_outer: {}
+				continue_outer: { }
 			}
 			}
 		}
 		}
 
 

+ 1 - 1
spine-csharp/src/Atlas.cs

@@ -261,7 +261,7 @@ namespace Spine {
 			int colon = line.IndexOf(':');
 			int colon = line.IndexOf(':');
 			if (colon == -1) return 0;
 			if (colon == -1) return 0;
 			entry[0] = line.Substring(0, colon).Trim();
 			entry[0] = line.Substring(0, colon).Trim();
-			for (int i = 1, lastMatch = colon + 1;; i++) {
+			for (int i = 1, lastMatch = colon + 1; ; i++) {
 				int comma = line.IndexOf(',', lastMatch);
 				int comma = line.IndexOf(',', lastMatch);
 				if (comma == -1) {
 				if (comma == -1) {
 					entry[i] = line.Substring(lastMatch).Trim();
 					entry[i] = line.Substring(lastMatch).Trim();

+ 1 - 1
spine-csharp/src/Attachments/AtlasAttachmentLoader.cs

@@ -89,7 +89,7 @@ namespace Spine {
 			return new PointAttachment(name);
 			return new PointAttachment(name);
 		}
 		}
 
 
-		public ClippingAttachment NewClippingAttachment(Skin skin, string name) {
+		public ClippingAttachment NewClippingAttachment (Skin skin, string name) {
 			return new ClippingAttachment(name);
 			return new ClippingAttachment(name);
 		}
 		}
 
 

+ 1 - 1
spine-csharp/src/Attachments/ClippingAttachment.cs

@@ -35,7 +35,7 @@ namespace Spine {
 
 
 		public SlotData EndSlot { get { return endSlot; } set { endSlot = value; } }
 		public SlotData EndSlot { get { return endSlot; } set { endSlot = value; } }
 
 
-		public ClippingAttachment(string name) : base(name) {
+		public ClippingAttachment (string name) : base(name) {
 		}
 		}
 
 
 		public override Attachment Copy () {
 		public override Attachment Copy () {

+ 1 - 1
spine-csharp/src/Attachments/MeshAttachment.cs

@@ -129,7 +129,7 @@ namespace Spine {
 				width = RegionOriginalHeight / textureWidth;
 				width = RegionOriginalHeight / textureWidth;
 				height = RegionOriginalWidth / textureHeight;
 				height = RegionOriginalWidth / textureHeight;
 
 
-				for (int i = 0, n = uvs.Length; i<n; i += 2) {
+				for (int i = 0, n = uvs.Length; i < n; i += 2) {
 					uvs[i] = u + (1 - regionUVs[i + 1]) * width;
 					uvs[i] = u + (1 - regionUVs[i + 1]) * width;
 					uvs[i + 1] = v + regionUVs[i] * height;
 					uvs[i + 1] = v + regionUVs[i] * height;
 				}
 				}

+ 1 - 2
spine-csharp/src/ConstraintData.cs

@@ -30,8 +30,7 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 
 
-namespace Spine
-{
+namespace Spine {
 	/// <summary>The base class for all constraint datas.</summary>
 	/// <summary>The base class for all constraint datas.</summary>
 	public abstract class ConstraintData {
 	public abstract class ConstraintData {
 		internal readonly string name;
 		internal readonly string name;

+ 1 - 1
spine-csharp/src/ExposedList.cs

@@ -298,7 +298,7 @@ namespace Spine {
 
 
 		private int GetLastIndex (int startIndex, int count, Predicate<T> match) {
 		private int GetLastIndex (int startIndex, int count, Predicate<T> match) {
 			// unlike FindLastIndex, takes regular params for search range
 			// unlike FindLastIndex, takes regular params for search range
-			for (int i = startIndex + count; i != startIndex; )
+			for (int i = startIndex + count; i != startIndex;)
 				if (match(Items[--i]))
 				if (match(Items[--i]))
 					return i;
 					return i;
 			return -1;
 			return -1;

+ 26 - 26
spine-csharp/src/IkConstraint.cs

@@ -166,27 +166,27 @@ namespace Spine {
 			float rotationIK = -bone.ashearX - bone.arotation;
 			float rotationIK = -bone.ashearX - bone.arotation;
 			float tx = 0, ty = 0;
 			float tx = 0, ty = 0;
 
 
-			switch(bone.data.transformMode) {
-				case TransformMode.OnlyTranslation:
-					tx = targetX - bone.worldX;
-					ty = targetY - bone.worldY;
-					break;
-				case TransformMode.NoRotationOrReflection: {
-					float s = Math.Abs(pa * pd - pb * pc) / (pa * pa + pc * pc);
-					float sa = pa / bone.skeleton.ScaleX;
-					float sc = pc / bone.skeleton.ScaleY;
-					pb = -sc * s * bone.skeleton.ScaleX;
-					pd = sa * s * bone.skeleton.ScaleY;
-					rotationIK += (float)Math.Atan2(sc, sa) * MathUtils.RadDeg;
-					goto default; // Fall through.
-				}
-				default: {
-					float x = targetX - p.worldX, y = targetY - p.worldY;
-					float d = pa * pd - pb * pc;
-					tx = (x * pd - y * pb) / d - bone.ax;
-					ty = (y * pa - x * pc) / d - bone.ay;
-					break;
-				}
+			switch (bone.data.transformMode) {
+			case TransformMode.OnlyTranslation:
+				tx = targetX - bone.worldX;
+				ty = targetY - bone.worldY;
+				break;
+			case TransformMode.NoRotationOrReflection: {
+				float s = Math.Abs(pa * pd - pb * pc) / (pa * pa + pc * pc);
+				float sa = pa / bone.skeleton.ScaleX;
+				float sc = pc / bone.skeleton.ScaleY;
+				pb = -sc * s * bone.skeleton.ScaleX;
+				pd = sa * s * bone.skeleton.ScaleY;
+				rotationIK += (float)Math.Atan2(sc, sa) * MathUtils.RadDeg;
+				goto default; // Fall through.
+			}
+			default: {
+				float x = targetX - p.worldX, y = targetY - p.worldY;
+				float d = pa * pd - pb * pc;
+				tx = (x * pd - y * pb) / d - bone.ax;
+				ty = (y * pa - x * pc) / d - bone.ay;
+				break;
+			}
 			}
 			}
 
 
 			rotationIK += (float)Math.Atan2(ty, tx) * MathUtils.RadDeg;
 			rotationIK += (float)Math.Atan2(ty, tx) * MathUtils.RadDeg;
@@ -199,11 +199,11 @@ namespace Spine {
 			float sx = bone.ascaleX, sy = bone.ascaleY;
 			float sx = bone.ascaleX, sy = bone.ascaleY;
 			if (compress || stretch) {
 			if (compress || stretch) {
 				switch (bone.data.transformMode) {
 				switch (bone.data.transformMode) {
-					case TransformMode.NoScale:
-					case TransformMode.NoScaleOrReflection:
-						tx = targetX - bone.worldX;
-						ty = targetY - bone.worldY;
-						break;
+				case TransformMode.NoScale:
+				case TransformMode.NoScaleOrReflection:
+					tx = targetX - bone.worldX;
+					ty = targetY - bone.worldY;
+					break;
 				}
 				}
 				float b = bone.data.length * sx, dd = (float)Math.Sqrt(tx * tx + ty * ty);
 				float b = bone.data.length * sx, dd = (float)Math.Sqrt(tx * tx + ty * ty);
 				if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001f) {
 				if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001f) {

+ 56 - 70
spine-csharp/src/Json.cs

@@ -28,11 +28,11 @@
  *****************************************************************************/
  *****************************************************************************/
 
 
 using System;
 using System;
-using System.IO;
-using System.Text;
 using System.Collections;
 using System.Collections;
-using System.Globalization;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Text;
 
 
 namespace Spine {
 namespace Spine {
 	public static class Json {
 	public static class Json {
@@ -70,10 +70,8 @@ namespace Spine {
  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
  */
-namespace SharpJson
-{
-	class Lexer
-	{
+namespace SharpJson {
+	class Lexer {
 		public enum Token {
 		public enum Token {
 			None,
 			None,
 			Null,
 			Null,
@@ -110,23 +108,20 @@ namespace SharpJson
 		bool success = true;
 		bool success = true;
 		char[] stringBuffer = new char[4096];
 		char[] stringBuffer = new char[4096];
 
 
-		public Lexer(string text)
-		{
+		public Lexer (string text) {
 			Reset();
 			Reset();
 
 
 			json = text.ToCharArray();
 			json = text.ToCharArray();
 			parseNumbersAsFloat = false;
 			parseNumbersAsFloat = false;
 		}
 		}
 
 
-		public void Reset()
-		{
+		public void Reset () {
 			index = 0;
 			index = 0;
 			lineNumber = 1;
 			lineNumber = 1;
 			success = true;
 			success = true;
 		}
 		}
 
 
-		public string ParseString()
-		{
+		public string ParseString () {
 			int idx = 0;
 			int idx = 0;
 			StringBuilder builder = null;
 			StringBuilder builder = null;
 
 
@@ -165,8 +160,8 @@ namespace SharpJson
 					case 'b':
 					case 'b':
 						stringBuffer[idx++] = '\b';
 						stringBuffer[idx++] = '\b';
 						break;
 						break;
-					case'f':
-							stringBuffer[idx++] = '\f';
+					case 'f':
+						stringBuffer[idx++] = '\f';
 						break;
 						break;
 					case 'n':
 					case 'n':
 						stringBuffer[idx++] = '\n';
 						stringBuffer[idx++] = '\n';
@@ -183,7 +178,7 @@ namespace SharpJson
 							var hex = new string(json, index, 4);
 							var hex = new string(json, index, 4);
 
 
 							// XXX: handle UTF
 							// XXX: handle UTF
-							stringBuffer[idx++] = (char) Convert.ToInt32(hex, 16);
+							stringBuffer[idx++] = (char)Convert.ToInt32(hex, 16);
 
 
 							// skip 4 chars
 							// skip 4 chars
 							index += 4;
 							index += 4;
@@ -211,40 +206,37 @@ namespace SharpJson
 			}
 			}
 
 
 			if (builder != null)
 			if (builder != null)
-				return builder.ToString ();
+				return builder.ToString();
 			else
 			else
-				return new string (stringBuffer, 0, idx);
+				return new string(stringBuffer, 0, idx);
 		}
 		}
 
 
-		string GetNumberString()
-		{
+		string GetNumberString () {
 			SkipWhiteSpaces();
 			SkipWhiteSpaces();
 
 
 			int lastIndex = GetLastIndexOfNumber(index);
 			int lastIndex = GetLastIndexOfNumber(index);
 			int charLength = (lastIndex - index) + 1;
 			int charLength = (lastIndex - index) + 1;
 
 
-			var result = new string (json, index, charLength);
+			var result = new string(json, index, charLength);
 
 
 			index = lastIndex + 1;
 			index = lastIndex + 1;
 
 
 			return result;
 			return result;
 		}
 		}
 
 
-		public float ParseFloatNumber()
-		{
+		public float ParseFloatNumber () {
 			float number;
 			float number;
-			var str = GetNumberString ();
+			var str = GetNumberString();
 
 
-			if (!float.TryParse (str, NumberStyles.Float, CultureInfo.InvariantCulture, out number))
+			if (!float.TryParse(str, NumberStyles.Float, CultureInfo.InvariantCulture, out number))
 				return 0;
 				return 0;
 
 
 			return number;
 			return number;
 		}
 		}
 
 
-		public double ParseDoubleNumber()
-		{
+		public double ParseDoubleNumber () {
 			double number;
 			double number;
-			var str = GetNumberString ();
+			var str = GetNumberString();
 
 
 			if (!double.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out number))
 			if (!double.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out number))
 				return 0;
 				return 0;
@@ -252,23 +244,21 @@ namespace SharpJson
 			return number;
 			return number;
 		}
 		}
 
 
-		int GetLastIndexOfNumber(int index)
-		{
+		int GetLastIndexOfNumber (int index) {
 			int lastIndex;
 			int lastIndex;
 
 
 			for (lastIndex = index; lastIndex < json.Length; lastIndex++) {
 			for (lastIndex = index; lastIndex < json.Length; lastIndex++) {
 				char ch = json[lastIndex];
 				char ch = json[lastIndex];
 
 
 				if ((ch < '0' || ch > '9') && ch != '+' && ch != '-'
 				if ((ch < '0' || ch > '9') && ch != '+' && ch != '-'
-				    && ch != '.' && ch != 'e' && ch != 'E')
+					&& ch != '.' && ch != 'e' && ch != 'E')
 					break;
 					break;
 			}
 			}
 
 
 			return lastIndex - 1;
 			return lastIndex - 1;
 		}
 		}
 
 
-		void SkipWhiteSpaces()
-		{
+		void SkipWhiteSpaces () {
 			for (; index < json.Length; index++) {
 			for (; index < json.Length; index++) {
 				char ch = json[index];
 				char ch = json[index];
 
 
@@ -280,22 +270,19 @@ namespace SharpJson
 			}
 			}
 		}
 		}
 
 
-		public Token LookAhead()
-		{
+		public Token LookAhead () {
 			SkipWhiteSpaces();
 			SkipWhiteSpaces();
 
 
 			int savedIndex = index;
 			int savedIndex = index;
 			return NextToken(json, ref savedIndex);
 			return NextToken(json, ref savedIndex);
 		}
 		}
 
 
-		public Token NextToken()
-		{
+		public Token NextToken () {
 			SkipWhiteSpaces();
 			SkipWhiteSpaces();
 			return NextToken(json, ref index);
 			return NextToken(json, ref index);
 		}
 		}
 
 
-		static Token NextToken(char[] json, ref int index)
-		{
+		static Token NextToken (char[] json, ref int index) {
 			if (index == json.Length)
 			if (index == json.Length)
 				return Token.None;
 				return Token.None;
 
 
@@ -314,8 +301,16 @@ namespace SharpJson
 				return Token.Comma;
 				return Token.Comma;
 			case '"':
 			case '"':
 				return Token.String;
 				return Token.String;
-			case '0': case '1': case '2': case '3': case '4':
-			case '5': case '6': case '7': case '8': case '9':
+			case '0':
+			case '1':
+			case '2':
+			case '3':
+			case '4':
+			case '5':
+			case '6':
+			case '7':
+			case '8':
+			case '9':
 			case '-':
 			case '-':
 				return Token.Number;
 				return Token.Number;
 			case ':':
 			case ':':
@@ -329,10 +324,10 @@ namespace SharpJson
 			// false
 			// false
 			if (remainingLength >= 5) {
 			if (remainingLength >= 5) {
 				if (json[index] == 'f' &&
 				if (json[index] == 'f' &&
-				    json[index + 1] == 'a' &&
-				    json[index + 2] == 'l' &&
-				    json[index + 3] == 's' &&
-				    json[index + 4] == 'e') {
+					json[index + 1] == 'a' &&
+					json[index + 2] == 'l' &&
+					json[index + 3] == 's' &&
+					json[index + 4] == 'e') {
 					index += 5;
 					index += 5;
 					return Token.False;
 					return Token.False;
 				}
 				}
@@ -341,9 +336,9 @@ namespace SharpJson
 			// true
 			// true
 			if (remainingLength >= 4) {
 			if (remainingLength >= 4) {
 				if (json[index] == 't' &&
 				if (json[index] == 't' &&
-				    json[index + 1] == 'r' &&
-				    json[index + 2] == 'u' &&
-				    json[index + 3] == 'e') {
+					json[index + 1] == 'r' &&
+					json[index + 2] == 'u' &&
+					json[index + 3] == 'e') {
 					index += 4;
 					index += 4;
 					return Token.True;
 					return Token.True;
 				}
 				}
@@ -352,9 +347,9 @@ namespace SharpJson
 			// null
 			// null
 			if (remainingLength >= 4) {
 			if (remainingLength >= 4) {
 				if (json[index] == 'n' &&
 				if (json[index] == 'n' &&
-				    json[index + 1] == 'u' &&
-				    json[index + 2] == 'l' &&
-				    json[index + 3] == 'l') {
+					json[index + 1] == 'u' &&
+					json[index + 2] == 'l' &&
+					json[index + 3] == 'l') {
 					index += 4;
 					index += 4;
 					return Token.Null;
 					return Token.Null;
 				}
 				}
@@ -364,8 +359,7 @@ namespace SharpJson
 		}
 		}
 	}
 	}
 
 
-	public class JsonDecoder
-	{
+	public class JsonDecoder {
 		public string errorMessage {
 		public string errorMessage {
 			get;
 			get;
 			private set;
 			private set;
@@ -378,14 +372,12 @@ namespace SharpJson
 
 
 		Lexer lexer;
 		Lexer lexer;
 
 
-		public JsonDecoder()
-		{
+		public JsonDecoder () {
 			errorMessage = null;
 			errorMessage = null;
 			parseNumbersAsFloat = false;
 			parseNumbersAsFloat = false;
 		}
 		}
 
 
-		public object Decode(string text)
-		{
+		public object Decode (string text) {
 			errorMessage = null;
 			errorMessage = null;
 
 
 			lexer = new Lexer(text);
 			lexer = new Lexer(text);
@@ -394,14 +386,12 @@ namespace SharpJson
 			return ParseValue();
 			return ParseValue();
 		}
 		}
 
 
-		public static object DecodeText(string text)
-		{
+		public static object DecodeText (string text) {
 			var builder = new JsonDecoder();
 			var builder = new JsonDecoder();
 			return builder.Decode(text);
 			return builder.Decode(text);
 		}
 		}
 
 
-		IDictionary<string, object> ParseObject()
-		{
+		IDictionary<string, object> ParseObject () {
 			var table = new Dictionary<string, object>();
 			var table = new Dictionary<string, object>();
 
 
 			// {
 			// {
@@ -449,8 +439,7 @@ namespace SharpJson
 			//return null; // Unreachable code
 			//return null; // Unreachable code
 		}
 		}
 
 
-		IList<object> ParseArray()
-		{
+		IList<object> ParseArray () {
 			var array = new List<object>();
 			var array = new List<object>();
 
 
 			// [
 			// [
@@ -483,8 +472,7 @@ namespace SharpJson
 			//return null; // Unreachable code
 			//return null; // Unreachable code
 		}
 		}
 
 
-		object ParseValue()
-		{
+		object ParseValue () {
 			switch (lexer.LookAhead()) {
 			switch (lexer.LookAhead()) {
 			case Lexer.Token.String:
 			case Lexer.Token.String:
 				return EvalLexer(lexer.ParseString());
 				return EvalLexer(lexer.ParseString());
@@ -514,14 +502,12 @@ namespace SharpJson
 			return null;
 			return null;
 		}
 		}
 
 
-		void TriggerError(string message)
-		{
+		void TriggerError (string message) {
 			errorMessage = string.Format("Error: '{0}' at line {1}",
 			errorMessage = string.Format("Error: '{0}' at line {1}",
-			                             message, lexer.lineNumber);
+										 message, lexer.lineNumber);
 		}
 		}
 
 
-		T EvalLexer<T>(T value)
-		{
+		T EvalLexer<T> (T value) {
 			if (lexer.hasError)
 			if (lexer.hasError)
 				TriggerError("Lexical error ocurred");
 				TriggerError("Lexical error ocurred");
 
 

+ 12 - 12
spine-csharp/src/MathUtils.cs

@@ -40,7 +40,7 @@ namespace Spine {
 
 
 		static Random random = new Random();
 		static Random random = new Random();
 
 
-	#if USE_FAST_SIN_COS_ATAN2_APPROXIMATIONS
+#if USE_FAST_SIN_COS_ATAN2_APPROXIMATIONS
 		const int SIN_BITS = 14; // 16KB. Adjust for accuracy.
 		const int SIN_BITS = 14; // 16KB. Adjust for accuracy.
 		const int SIN_MASK = ~(-1 << SIN_BITS);
 		const int SIN_MASK = ~(-1 << SIN_BITS);
 		const int SIN_COUNT = SIN_MASK + 1;
 		const int SIN_COUNT = SIN_MASK + 1;
@@ -94,7 +94,7 @@ namespace Spine {
 			atan = PI / 2 - z / (z * z + 0.28f);
 			atan = PI / 2 - z / (z * z + 0.28f);
 			return y < 0f ? atan - PI : atan;
 			return y < 0f ? atan - PI : atan;
 		}
 		}
-	#else
+#else
 		/// <summary>Returns the sine of a given angle in radians.</summary>
 		/// <summary>Returns the sine of a given angle in radians.</summary>
 		static public float Sin (float radians) {
 		static public float Sin (float radians) {
 			return (float)Math.Sin(radians);
 			return (float)Math.Sin(radians);
@@ -119,18 +119,18 @@ namespace Spine {
 		static public float Atan2 (float y, float x) {
 		static public float Atan2 (float y, float x) {
 			return (float)Math.Atan2(y, x);
 			return (float)Math.Atan2(y, x);
 		}
 		}
-	#endif
+#endif
 		static public float Clamp (float value, float min, float max) {
 		static public float Clamp (float value, float min, float max) {
 			if (value < min) return min;
 			if (value < min) return min;
 			if (value > max) return max;
 			if (value > max) return max;
 			return value;
 			return value;
 		}
 		}
 
 
-		static public float RandomTriangle(float min, float max) {
+		static public float RandomTriangle (float min, float max) {
 			return RandomTriangle(min, max, (min + max) * 0.5f);
 			return RandomTriangle(min, max, (min + max) * 0.5f);
 		}
 		}
 
 
-		static public float RandomTriangle(float min, float max, float mode) {
+		static public float RandomTriangle (float min, float max, float mode) {
 			float u = (float)random.NextDouble();
 			float u = (float)random.NextDouble();
 			float d = max - min;
 			float d = max - min;
 			if (u <= (mode - min) / d) return min + (float)Math.Sqrt(u * d * (mode - min));
 			if (u <= (mode - min) / d) return min + (float)Math.Sqrt(u * d * (mode - min));
@@ -142,31 +142,31 @@ namespace Spine {
 		public static IInterpolation Pow2 = new Pow(2);
 		public static IInterpolation Pow2 = new Pow(2);
 		public static IInterpolation Pow2Out = new PowOut(2);
 		public static IInterpolation Pow2Out = new PowOut(2);
 
 
-		protected abstract float Apply(float a);
+		protected abstract float Apply (float a);
 
 
-		public float Apply(float start, float end, float a) {
+		public float Apply (float start, float end, float a) {
 			return start + (end - start) * Apply(a);
 			return start + (end - start) * Apply(a);
 		}
 		}
 	}
 	}
 
 
-	public class Pow: IInterpolation {
+	public class Pow : IInterpolation {
 		public float Power { get; set; }
 		public float Power { get; set; }
 
 
-		public Pow(float power) {
+		public Pow (float power) {
 			Power = power;
 			Power = power;
 		}
 		}
 
 
-		protected override float Apply(float a) {
+		protected override float Apply (float a) {
 			if (a <= 0.5f) return (float)Math.Pow(a * 2, Power) / 2;
 			if (a <= 0.5f) return (float)Math.Pow(a * 2, Power) / 2;
 			return (float)Math.Pow((a - 1) * 2, Power) / (Power % 2 == 0 ? -2 : 2) + 1;
 			return (float)Math.Pow((a - 1) * 2, Power) / (Power % 2 == 0 ? -2 : 2) + 1;
 		}
 		}
 	}
 	}
 
 
 	public class PowOut : Pow {
 	public class PowOut : Pow {
-		public PowOut(float power) : base(power) {
+		public PowOut (float power) : base(power) {
 		}
 		}
 
 
-		protected override float Apply(float a) {
+		protected override float Apply (float a) {
 			return (float)Math.Pow(a - 1, Power) * (Power % 2 == 0 ? -1 : 1) + 1;
 			return (float)Math.Pow(a - 1, Power) * (Power % 2 == 0 ? -1 : 1) + 1;
 		}
 		}
 	}
 	}

+ 3 - 3
spine-csharp/src/PathConstraint.cs

@@ -272,7 +272,7 @@ namespace Spine {
 					}
 					}
 
 
 					// Determine curve containing position.
 					// Determine curve containing position.
-					for (;; curve++) {
+					for (; ; curve++) {
 						float length = lengths[curve];
 						float length = lengths[curve];
 						if (p > length) continue;
 						if (p > length) continue;
 						if (curve == 0)
 						if (curve == 0)
@@ -383,7 +383,7 @@ namespace Spine {
 				}
 				}
 
 
 				// Determine curve containing position.
 				// Determine curve containing position.
-				for (;; curve++) {
+				for (; ; curve++) {
 					float length = curves[curve];
 					float length = curves[curve];
 					if (p > length) continue;
 					if (p > length) continue;
 					if (curve == 0)
 					if (curve == 0)
@@ -438,7 +438,7 @@ namespace Spine {
 
 
 				// Weight by segment length.
 				// Weight by segment length.
 				p *= curveLength;
 				p *= curveLength;
-				for (;; segment++) {
+				for (; ; segment++) {
 					float length = segments[segment];
 					float length = segments[segment];
 					if (p > length) continue;
 					if (p > length) continue;
 					if (segment == 0)
 					if (segment == 0)

+ 4 - 4
spine-csharp/src/Skeleton.cs

@@ -117,7 +117,7 @@ namespace Spine {
 			foreach (TransformConstraintData transformConstraintData in data.transformConstraints)
 			foreach (TransformConstraintData transformConstraintData in data.transformConstraints)
 				transformConstraints.Add(new TransformConstraint(transformConstraintData, this));
 				transformConstraints.Add(new TransformConstraint(transformConstraintData, this));
 
 
-			pathConstraints = new ExposedList<PathConstraint> (data.pathConstraints.Count);
+			pathConstraints = new ExposedList<PathConstraint>(data.pathConstraints.Count);
 			foreach (PathConstraintData pathConstraintData in data.pathConstraints)
 			foreach (PathConstraintData pathConstraintData in data.pathConstraints)
 				pathConstraints.Add(new PathConstraint(pathConstraintData, this));
 				pathConstraints.Add(new PathConstraint(pathConstraintData, this));
 
 
@@ -177,7 +177,7 @@ namespace Spine {
 						goto continue_outer;
 						goto continue_outer;
 					}
 					}
 				}
 				}
-				continue_outer: {}
+				continue_outer: { }
 			}
 			}
 
 
 			for (int i = 0; i < boneCount; i++)
 			for (int i = 0; i < boneCount; i++)
@@ -332,7 +332,7 @@ namespace Spine {
 		/// <summary>
 		/// <summary>
 		/// Temporarily sets the root bone as a child of the specified bone, then updates the world transform for each bone and applies
 		/// Temporarily sets the root bone as a child of the specified bone, then updates the world transform for each bone and applies
 		/// all constraints.
 		/// all constraints.
-	 	/// </summary>
+		/// </summary>
 		public void UpdateWorldTransform (Bone parent) {
 		public void UpdateWorldTransform (Bone parent) {
 			if (parent == null) throw new ArgumentNullException("parent", "parent cannot be null.");
 			if (parent == null) throw new ArgumentNullException("parent", "parent cannot be null.");
 
 
@@ -472,7 +472,7 @@ namespace Spine {
 		/// <para>Sets the skin used to look up attachments before looking in the <see cref="SkeletonData.DefaultSkin"/>. If the
 		/// <para>Sets the skin used to look up attachments before looking in the <see cref="SkeletonData.DefaultSkin"/>. If the
 		/// skin is changed, <see cref="UpdateCache()"/> is called.
 		/// skin is changed, <see cref="UpdateCache()"/> is called.
 		/// </para>
 		/// </para>
-	 	/// <para>Attachments from the new skin are attached if the corresponding attachment from the old skin was attached.
+		/// <para>Attachments from the new skin are attached if the corresponding attachment from the old skin was attached.
 		/// If there was no old skin, each slot's setup mode attachment is attached from the new skin.
 		/// If there was no old skin, each slot's setup mode attachment is attached from the new skin.
 		/// </para>
 		/// </para>
 		/// <para>After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling
 		/// <para>After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling

+ 225 - 226
spine-csharp/src/SkeletonBinary.cs

@@ -32,8 +32,8 @@
 #endif
 #endif
 
 
 using System;
 using System;
-using System.IO;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
 using System.Runtime.Serialization;
 using System.Runtime.Serialization;
 
 
 #if WINDOWS_STOREAPP
 #if WINDOWS_STOREAPP
@@ -70,7 +70,7 @@ namespace Spine {
 		public const int CURVE_BEZIER = 2;
 		public const int CURVE_BEZIER = 2;
 
 
 		public SkeletonBinary (AttachmentLoader attachmentLoader)
 		public SkeletonBinary (AttachmentLoader attachmentLoader)
-			:base(attachmentLoader) {
+			: base(attachmentLoader) {
 		}
 		}
 
 
 		public SkeletonBinary (params Atlas[] atlasArray)
 		public SkeletonBinary (params Atlas[] atlasArray)
@@ -92,17 +92,17 @@ namespace Spine {
 		}
 		}
 #else
 #else
 		public override SkeletonData ReadSkeletonData (string path) {
 		public override SkeletonData ReadSkeletonData (string path) {
-		#if WINDOWS_PHONE
+#if WINDOWS_PHONE
 			using (var input = new BufferedStream(Microsoft.Xna.Framework.TitleContainer.OpenStream(path))) {
 			using (var input = new BufferedStream(Microsoft.Xna.Framework.TitleContainer.OpenStream(path))) {
-		#else
+#else
 			using (var input = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) {
 			using (var input = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) {
-		#endif
+#endif
 				SkeletonData skeletonData = ReadSkeletonData(input);
 				SkeletonData skeletonData = ReadSkeletonData(input);
 				skeletonData.name = Path.GetFileNameWithoutExtension(path);
 				skeletonData.name = Path.GetFileNameWithoutExtension(path);
 				return skeletonData;
 				return skeletonData;
 			}
 			}
 		}
 		}
-		#endif // WINDOWS_STOREAPP
+#endif // WINDOWS_STOREAPP
 
 
 		public static readonly TransformMode[] TransformModeValues = {
 		public static readonly TransformMode[] TransformModeValues = {
 			TransformMode.Normal,
 			TransformMode.Normal,
@@ -539,7 +539,7 @@ namespace Spine {
 			float scale = this.scale;
 			float scale = this.scale;
 			int verticesLength = vertexCount << 1;
 			int verticesLength = vertexCount << 1;
 			Vertices vertices = new Vertices();
 			Vertices vertices = new Vertices();
-			if(!input.ReadBoolean()) {
+			if (!input.ReadBoolean()) {
 				vertices.vertices = ReadFloatArray(input, verticesLength, scale);
 				vertices.vertices = ReadFloatArray(input, verticesLength, scale);
 				return vertices;
 				return vertices;
 			}
 			}
@@ -593,167 +593,167 @@ namespace Spine {
 				for (int ii = 0, nn = input.ReadInt(true); ii < nn; ii++) {
 				for (int ii = 0, nn = input.ReadInt(true); ii < nn; ii++) {
 					int timelineType = input.ReadByte(), frameCount = input.ReadInt(true), frameLast = frameCount - 1;
 					int timelineType = input.ReadByte(), frameCount = input.ReadInt(true), frameLast = frameCount - 1;
 					switch (timelineType) {
 					switch (timelineType) {
-						case SLOT_ATTACHMENT: {
-								AttachmentTimeline timeline = new AttachmentTimeline(frameCount, slotIndex);
-								for (int frame = 0; frame < frameCount; frame++)
-									timeline.SetFrame(frame, input.ReadFloat(), input.ReadStringRef());
-								timelines.Add(timeline);
+					case SLOT_ATTACHMENT: {
+						AttachmentTimeline timeline = new AttachmentTimeline(frameCount, slotIndex);
+						for (int frame = 0; frame < frameCount; frame++)
+							timeline.SetFrame(frame, input.ReadFloat(), input.ReadStringRef());
+						timelines.Add(timeline);
+						break;
+					}
+					case SLOT_RGBA: {
+						RGBATimeline timeline = new RGBATimeline(frameCount, input.ReadInt(true), slotIndex);
+						float time = input.ReadFloat();
+						float r = input.Read() / 255f, g = input.Read() / 255f;
+						float b = input.Read() / 255f, a = input.Read() / 255f;
+						for (int frame = 0, bezier = 0; ; frame++) {
+							timeline.SetFrame(frame, time, r, g, b, a);
+							if (frame == frameLast) break;
+							float time2 = input.ReadFloat();
+							float r2 = input.Read() / 255f, g2 = input.Read() / 255f;
+							float b2 = input.Read() / 255f, a2 = input.Read() / 255f;
+							switch (input.ReadByte()) {
+							case CURVE_STEPPED:
+								timeline.SetStepped(frame);
 								break;
 								break;
-							}
-						case SLOT_RGBA: {
-								RGBATimeline timeline = new RGBATimeline(frameCount, input.ReadInt(true), slotIndex);
-								float time = input.ReadFloat();
-								float r = input.Read() / 255f, g = input.Read() / 255f;
-								float b = input.Read() / 255f, a = input.Read() / 255f;
-								for (int frame = 0, bezier = 0; ; frame++) {
-									timeline.SetFrame(frame, time, r, g, b, a);
-									if (frame == frameLast) break;
-									float time2 = input.ReadFloat();
-									float r2 = input.Read() / 255f, g2 = input.Read() / 255f;
-									float b2 = input.Read() / 255f, a2 = input.Read() / 255f;
-									switch (input.ReadByte()) {
-										case CURVE_STEPPED:
-											timeline.SetStepped(frame);
-											break;
-										case CURVE_BEZIER:
-											SetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);
-											SetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);
-											SetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);
-											SetBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1);
-											break;
-									}
-									time = time2;
-									r = r2;
-									g = g2;
-									b = b2;
-									a = a2;
-								}
-								timelines.Add(timeline);
+							case CURVE_BEZIER:
+								SetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);
+								SetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);
+								SetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);
+								SetBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1);
 								break;
 								break;
 							}
 							}
-						case SLOT_RGB: {
-								RGBTimeline timeline = new RGBTimeline(frameCount, input.ReadInt(true), slotIndex);
-								float time = input.ReadFloat();
-								float r = input.Read() / 255f, g = input.Read() / 255f, b = input.Read() / 255f;
-								for (int frame = 0, bezier = 0; ; frame++) {
-									timeline.SetFrame(frame, time, r, g, b);
-									if (frame == frameLast) break;
-									float time2 = input.ReadFloat();
-									float r2 = input.Read() / 255f, g2 = input.Read() / 255f, b2 = input.Read() / 255f;
-									switch (input.ReadByte()) {
-										case CURVE_STEPPED:
-											timeline.SetStepped(frame);
-											break;
-										case CURVE_BEZIER:
-											SetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);
-											SetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);
-											SetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);
-											break;
-									}
-									time = time2;
-									r = r2;
-									g = g2;
-									b = b2;
-								}
-								timelines.Add(timeline);
+							time = time2;
+							r = r2;
+							g = g2;
+							b = b2;
+							a = a2;
+						}
+						timelines.Add(timeline);
+						break;
+					}
+					case SLOT_RGB: {
+						RGBTimeline timeline = new RGBTimeline(frameCount, input.ReadInt(true), slotIndex);
+						float time = input.ReadFloat();
+						float r = input.Read() / 255f, g = input.Read() / 255f, b = input.Read() / 255f;
+						for (int frame = 0, bezier = 0; ; frame++) {
+							timeline.SetFrame(frame, time, r, g, b);
+							if (frame == frameLast) break;
+							float time2 = input.ReadFloat();
+							float r2 = input.Read() / 255f, g2 = input.Read() / 255f, b2 = input.Read() / 255f;
+							switch (input.ReadByte()) {
+							case CURVE_STEPPED:
+								timeline.SetStepped(frame);
+								break;
+							case CURVE_BEZIER:
+								SetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);
+								SetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);
+								SetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);
 								break;
 								break;
 							}
 							}
-						case SLOT_RGBA2: {
-								RGBA2Timeline timeline = new RGBA2Timeline(frameCount, input.ReadInt(true), slotIndex);
-								float time = input.ReadFloat();
-								float r = input.Read() / 255f, g = input.Read() / 255f;
-								float b = input.Read() / 255f, a = input.Read() / 255f;
-								float r2 = input.Read() / 255f, g2 = input.Read() / 255f, b2 = input.Read() / 255f;
-								for (int frame = 0, bezier = 0; ; frame++) {
-									timeline.SetFrame(frame, time, r, g, b, a, r2, g2, b2);
-									if (frame == frameLast) break;
-									float time2 = input.ReadFloat();
-									float nr = input.Read() / 255f, ng = input.Read() / 255f;
-									float nb = input.Read() / 255f, na = input.Read() / 255f;
-									float nr2 = input.Read() / 255f, ng2 = input.Read() / 255f, nb2 = input.Read() / 255f;
-									switch (input.ReadByte()) {
-										case CURVE_STEPPED:
-											timeline.SetStepped(frame);
-											break;
-										case CURVE_BEZIER:
-											SetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);
-											SetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);
-											SetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);
-											SetBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1);
-											SetBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1);
-											SetBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1);
-											SetBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1);
-											break;
-									}
-									time = time2;
-									r = nr;
-									g = ng;
-									b = nb;
-									a = na;
-									r2 = nr2;
-									g2 = ng2;
-									b2 = nb2;
-								}
-								timelines.Add(timeline);
+							time = time2;
+							r = r2;
+							g = g2;
+							b = b2;
+						}
+						timelines.Add(timeline);
+						break;
+					}
+					case SLOT_RGBA2: {
+						RGBA2Timeline timeline = new RGBA2Timeline(frameCount, input.ReadInt(true), slotIndex);
+						float time = input.ReadFloat();
+						float r = input.Read() / 255f, g = input.Read() / 255f;
+						float b = input.Read() / 255f, a = input.Read() / 255f;
+						float r2 = input.Read() / 255f, g2 = input.Read() / 255f, b2 = input.Read() / 255f;
+						for (int frame = 0, bezier = 0; ; frame++) {
+							timeline.SetFrame(frame, time, r, g, b, a, r2, g2, b2);
+							if (frame == frameLast) break;
+							float time2 = input.ReadFloat();
+							float nr = input.Read() / 255f, ng = input.Read() / 255f;
+							float nb = input.Read() / 255f, na = input.Read() / 255f;
+							float nr2 = input.Read() / 255f, ng2 = input.Read() / 255f, nb2 = input.Read() / 255f;
+							switch (input.ReadByte()) {
+							case CURVE_STEPPED:
+								timeline.SetStepped(frame);
+								break;
+							case CURVE_BEZIER:
+								SetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);
+								SetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);
+								SetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);
+								SetBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1);
+								SetBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1);
+								SetBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1);
+								SetBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1);
 								break;
 								break;
 							}
 							}
-						case SLOT_RGB2: {
-								RGB2Timeline timeline = new RGB2Timeline(frameCount, input.ReadInt(true), slotIndex);
-								float time = input.ReadFloat();
-								float r = input.Read() / 255f, g = input.Read() / 255f, b = input.Read() / 255f;
-								float r2 = input.Read() / 255f, g2 = input.Read() / 255f, b2 = input.Read() / 255f;
-								for (int frame = 0, bezier = 0; ; frame++) {
-									timeline.SetFrame(frame, time, r, g, b, r2, g2, b2);
-									if (frame == frameLast) break;
-									float time2 = input.ReadFloat();
-									float nr = input.Read() / 255f, ng = input.Read() / 255f, nb = input.Read() / 255f;
-									float nr2 = input.Read() / 255f, ng2 = input.Read() / 255f, nb2 = input.Read() / 255f;
-									switch (input.ReadByte()) {
-										case CURVE_STEPPED:
-											timeline.SetStepped(frame);
-											break;
-										case CURVE_BEZIER:
-											SetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);
-											SetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);
-											SetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);
-											SetBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1);
-											SetBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1);
-											SetBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1);
-											break;
-									}
-									time = time2;
-									r = nr;
-									g = ng;
-									b = nb;
-									r2 = nr2;
-									g2 = ng2;
-									b2 = nb2;
-								}
-								timelines.Add(timeline);
+							time = time2;
+							r = nr;
+							g = ng;
+							b = nb;
+							a = na;
+							r2 = nr2;
+							g2 = ng2;
+							b2 = nb2;
+						}
+						timelines.Add(timeline);
+						break;
+					}
+					case SLOT_RGB2: {
+						RGB2Timeline timeline = new RGB2Timeline(frameCount, input.ReadInt(true), slotIndex);
+						float time = input.ReadFloat();
+						float r = input.Read() / 255f, g = input.Read() / 255f, b = input.Read() / 255f;
+						float r2 = input.Read() / 255f, g2 = input.Read() / 255f, b2 = input.Read() / 255f;
+						for (int frame = 0, bezier = 0; ; frame++) {
+							timeline.SetFrame(frame, time, r, g, b, r2, g2, b2);
+							if (frame == frameLast) break;
+							float time2 = input.ReadFloat();
+							float nr = input.Read() / 255f, ng = input.Read() / 255f, nb = input.Read() / 255f;
+							float nr2 = input.Read() / 255f, ng2 = input.Read() / 255f, nb2 = input.Read() / 255f;
+							switch (input.ReadByte()) {
+							case CURVE_STEPPED:
+								timeline.SetStepped(frame);
+								break;
+							case CURVE_BEZIER:
+								SetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);
+								SetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);
+								SetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);
+								SetBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1);
+								SetBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1);
+								SetBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1);
 								break;
 								break;
 							}
 							}
-						case SLOT_ALPHA: {
-								AlphaTimeline timeline = new AlphaTimeline(frameCount, input.ReadInt(true), slotIndex);
-								float time = input.ReadFloat(), a = input.Read() / 255f;
-								for (int frame = 0, bezier = 0; ; frame++) {
-									timeline.SetFrame(frame, time, a);
-									if (frame == frameLast) break;
-									float time2 = input.ReadFloat();
-									float a2 = input.Read() / 255f;
-									switch (input.ReadByte()) {
-										case CURVE_STEPPED:
-											timeline.SetStepped(frame);
-											break;
-										case CURVE_BEZIER:
-											SetBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1);
-											break;
-									}
-									time = time2;
-									a = a2;
-								}
-								timelines.Add(timeline);
+							time = time2;
+							r = nr;
+							g = ng;
+							b = nb;
+							r2 = nr2;
+							g2 = ng2;
+							b2 = nb2;
+						}
+						timelines.Add(timeline);
+						break;
+					}
+					case SLOT_ALPHA: {
+						AlphaTimeline timeline = new AlphaTimeline(frameCount, input.ReadInt(true), slotIndex);
+						float time = input.ReadFloat(), a = input.Read() / 255f;
+						for (int frame = 0, bezier = 0; ; frame++) {
+							timeline.SetFrame(frame, time, a);
+							if (frame == frameLast) break;
+							float time2 = input.ReadFloat();
+							float a2 = input.Read() / 255f;
+							switch (input.ReadByte()) {
+							case CURVE_STEPPED:
+								timeline.SetStepped(frame);
+								break;
+							case CURVE_BEZIER:
+								SetBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1);
 								break;
 								break;
 							}
 							}
+							time = time2;
+							a = a2;
+						}
+						timelines.Add(timeline);
+						break;
+					}
 					}
 					}
 				}
 				}
 			}
 			}
@@ -764,36 +764,36 @@ namespace Spine {
 				for (int ii = 0, nn = input.ReadInt(true); ii < nn; ii++) {
 				for (int ii = 0, nn = input.ReadInt(true); ii < nn; ii++) {
 					int type = input.ReadByte(), frameCount = input.ReadInt(true), bezierCount = input.ReadInt(true);
 					int type = input.ReadByte(), frameCount = input.ReadInt(true), bezierCount = input.ReadInt(true);
 					switch (type) {
 					switch (type) {
-						case BONE_ROTATE:
-							timelines.Add(ReadTimeline(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1));
-							break;
-						case BONE_TRANSLATE:
-							timelines.Add(ReadTimeline(input, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale));
-							break;
-						case BONE_TRANSLATEX:
-							timelines.Add(ReadTimeline(input, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale));
-							break;
-						case BONE_TRANSLATEY:
-							timelines.Add(ReadTimeline(input, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale));
-							break;
-						case BONE_SCALE:
-							timelines.Add(ReadTimeline(input, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1));
-							break;
-						case BONE_SCALEX:
-							timelines.Add(ReadTimeline(input, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1));
-							break;
-						case BONE_SCALEY:
-							timelines.Add(ReadTimeline(input, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1));
-							break;
-						case BONE_SHEAR:
-							timelines.Add(ReadTimeline(input, new ShearTimeline(frameCount, bezierCount, boneIndex), 1));
-							break;
-						case BONE_SHEARX:
-							timelines.Add(ReadTimeline(input, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1));
-							break;
-						case BONE_SHEARY:
-							timelines.Add(ReadTimeline(input, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1));
-							break;
+					case BONE_ROTATE:
+						timelines.Add(ReadTimeline(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1));
+						break;
+					case BONE_TRANSLATE:
+						timelines.Add(ReadTimeline(input, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale));
+						break;
+					case BONE_TRANSLATEX:
+						timelines.Add(ReadTimeline(input, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale));
+						break;
+					case BONE_TRANSLATEY:
+						timelines.Add(ReadTimeline(input, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale));
+						break;
+					case BONE_SCALE:
+						timelines.Add(ReadTimeline(input, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1));
+						break;
+					case BONE_SCALEX:
+						timelines.Add(ReadTimeline(input, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1));
+						break;
+					case BONE_SCALEY:
+						timelines.Add(ReadTimeline(input, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1));
+						break;
+					case BONE_SHEAR:
+						timelines.Add(ReadTimeline(input, new ShearTimeline(frameCount, bezierCount, boneIndex), 1));
+						break;
+					case BONE_SHEARX:
+						timelines.Add(ReadTimeline(input, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1));
+						break;
+					case BONE_SHEARY:
+						timelines.Add(ReadTimeline(input, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1));
+						break;
 					}
 					}
 				}
 				}
 			}
 			}
@@ -808,13 +808,13 @@ namespace Spine {
 					if (frame == frameLast) break;
 					if (frame == frameLast) break;
 					float time2 = input.ReadFloat(), mix2 = input.ReadFloat(), softness2 = input.ReadFloat() * scale;
 					float time2 = input.ReadFloat(), mix2 = input.ReadFloat(), softness2 = input.ReadFloat() * scale;
 					switch (input.ReadByte()) {
 					switch (input.ReadByte()) {
-						case CURVE_STEPPED:
-							timeline.SetStepped(frame);
-							break;
-						case CURVE_BEZIER:
-							SetBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);
-							SetBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);
-							break;
+					case CURVE_STEPPED:
+						timeline.SetStepped(frame);
+						break;
+					case CURVE_BEZIER:
+						SetBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);
+						SetBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);
+						break;
 					}
 					}
 					time = time2;
 					time = time2;
 					mix = mix2;
 					mix = mix2;
@@ -835,17 +835,17 @@ namespace Spine {
 					float time2 = input.ReadFloat(), mixRotate2 = input.ReadFloat(), mixX2 = input.ReadFloat(), mixY2 = input.ReadFloat(),
 					float time2 = input.ReadFloat(), mixRotate2 = input.ReadFloat(), mixX2 = input.ReadFloat(), mixY2 = input.ReadFloat(),
 					mixScaleX2 = input.ReadFloat(), mixScaleY2 = input.ReadFloat(), mixShearY2 = input.ReadFloat();
 					mixScaleX2 = input.ReadFloat(), mixScaleY2 = input.ReadFloat(), mixShearY2 = input.ReadFloat();
 					switch (input.ReadByte()) {
 					switch (input.ReadByte()) {
-						case CURVE_STEPPED:
-							timeline.SetStepped(frame);
-							break;
-						case CURVE_BEZIER:
-							SetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);
-							SetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);
-							SetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);
-							SetBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);
-							SetBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);
-							SetBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1);
-							break;
+					case CURVE_STEPPED:
+						timeline.SetStepped(frame);
+						break;
+					case CURVE_BEZIER:
+						SetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);
+						SetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);
+						SetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);
+						SetBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);
+						SetBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);
+						SetBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1);
+						break;
 					}
 					}
 					time = time2;
 					time = time2;
 					mixRotate = mixRotate2;
 					mixRotate = mixRotate2;
@@ -884,14 +884,14 @@ namespace Spine {
 							float time2 = input.ReadFloat(), mixRotate2 = input.ReadFloat(), mixX2 = input.ReadFloat(),
 							float time2 = input.ReadFloat(), mixRotate2 = input.ReadFloat(), mixX2 = input.ReadFloat(),
 								mixY2 = input.ReadFloat();
 								mixY2 = input.ReadFloat();
 							switch (input.ReadByte()) {
 							switch (input.ReadByte()) {
-								case CURVE_STEPPED:
-									timeline.SetStepped(frame);
-									break;
-								case CURVE_BEZIER:
-									SetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);
-									SetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);
-									SetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);
-									break;
+							case CURVE_STEPPED:
+								timeline.SetStepped(frame);
+								break;
+							case CURVE_BEZIER:
+								SetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);
+								SetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);
+								SetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);
+								break;
 							}
 							}
 							time = time2;
 							time = time2;
 							mixRotate = mixRotate2;
 							mixRotate = mixRotate2;
@@ -1022,7 +1022,7 @@ namespace Spine {
 		/// <exception cref="IOException">Throws IOException when a read operation fails.</exception>
 		/// <exception cref="IOException">Throws IOException when a read operation fails.</exception>
 		private Timeline ReadTimeline (SkeletonInput input, CurveTimeline1 timeline, float scale) {
 		private Timeline ReadTimeline (SkeletonInput input, CurveTimeline1 timeline, float scale) {
 			float time = input.ReadFloat(), value = input.ReadFloat() * scale;
 			float time = input.ReadFloat(), value = input.ReadFloat() * scale;
-			for (int frame = 0, bezier = 0, frameLast = timeline.FrameCount - 1;; frame++) {
+			for (int frame = 0, bezier = 0, frameLast = timeline.FrameCount - 1; ; frame++) {
 				timeline.SetFrame(frame, time, value);
 				timeline.SetFrame(frame, time, value);
 				if (frame == frameLast) break;
 				if (frame == frameLast) break;
 				float time2 = input.ReadFloat(), value2 = input.ReadFloat() * scale;
 				float time2 = input.ReadFloat(), value2 = input.ReadFloat() * scale;
@@ -1031,8 +1031,8 @@ namespace Spine {
 					timeline.SetStepped(frame);
 					timeline.SetStepped(frame);
 					break;
 					break;
 				case CURVE_BEZIER:
 				case CURVE_BEZIER:
-					SetBezier (input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);
-						break;
+					SetBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);
+					break;
 				}
 				}
 				time = time2;
 				time = time2;
 				value = value2;
 				value = value2;
@@ -1043,18 +1043,18 @@ namespace Spine {
 		/// <exception cref="IOException">Throws IOException when a read operation fails.</exception>
 		/// <exception cref="IOException">Throws IOException when a read operation fails.</exception>
 		private Timeline ReadTimeline (SkeletonInput input, CurveTimeline2 timeline, float scale) {
 		private Timeline ReadTimeline (SkeletonInput input, CurveTimeline2 timeline, float scale) {
 			float time = input.ReadFloat(), value1 = input.ReadFloat() * scale, value2 = input.ReadFloat() * scale;
 			float time = input.ReadFloat(), value1 = input.ReadFloat() * scale, value2 = input.ReadFloat() * scale;
-			for (int frame = 0, bezier = 0, frameLast = timeline.FrameCount - 1;; frame++) {
+			for (int frame = 0, bezier = 0, frameLast = timeline.FrameCount - 1; ; frame++) {
 				timeline.SetFrame(frame, time, value1, value2);
 				timeline.SetFrame(frame, time, value1, value2);
 				if (frame == frameLast) break;
 				if (frame == frameLast) break;
 				float time2 = input.ReadFloat(), nvalue1 = input.ReadFloat() * scale, nvalue2 = input.ReadFloat() * scale;
 				float time2 = input.ReadFloat(), nvalue1 = input.ReadFloat() * scale, nvalue2 = input.ReadFloat() * scale;
 				switch (input.ReadByte()) {
 				switch (input.ReadByte()) {
-					case CURVE_STEPPED:
-						timeline.SetStepped(frame);
-						break;
-					case CURVE_BEZIER:
-						SetBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale);
-						SetBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale);
-						break;
+				case CURVE_STEPPED:
+					timeline.SetStepped(frame);
+					break;
+				case CURVE_BEZIER:
+					SetBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale);
+					SetBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale);
+					break;
 				}
 				}
 				time = time2;
 				time = time2;
 				value1 = nvalue1;
 				value1 = nvalue1;
@@ -1070,8 +1070,7 @@ namespace Spine {
 					input.ReadFloat() * scale, time2, value2);
 					input.ReadFloat() * scale, time2, value2);
 		}
 		}
 
 
-		internal class Vertices
-		{
+		internal class Vertices {
 			public int[] bones;
 			public int[] bones;
 			public float[] vertices;
 			public float[] vertices;
 		}
 		}

+ 1 - 1
spine-csharp/src/SkeletonData.cs

@@ -43,7 +43,7 @@ namespace Spine {
 		internal ExposedList<IkConstraintData> ikConstraints = new ExposedList<IkConstraintData>();
 		internal ExposedList<IkConstraintData> ikConstraints = new ExposedList<IkConstraintData>();
 		internal ExposedList<TransformConstraintData> transformConstraints = new ExposedList<TransformConstraintData>();
 		internal ExposedList<TransformConstraintData> transformConstraints = new ExposedList<TransformConstraintData>();
 		internal ExposedList<PathConstraintData> pathConstraints = new ExposedList<PathConstraintData>();
 		internal ExposedList<PathConstraintData> pathConstraints = new ExposedList<PathConstraintData>();
-		internal float x , y, width, height;
+		internal float x, y, width, height;
 		internal string version, hash;
 		internal string version, hash;
 
 
 		// Nonessential.
 		// Nonessential.

+ 78 - 78
spine-csharp/src/SkeletonJson.cs

@@ -32,8 +32,8 @@
 #endif
 #endif
 
 
 using System;
 using System;
-using System.IO;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
 
 
 #if WINDOWS_STOREAPP
 #if WINDOWS_STOREAPP
 using System.Threading.Tasks;
 using System.Threading.Tasks;
@@ -77,17 +77,17 @@ namespace Spine {
 		}
 		}
 #else
 #else
 		public override SkeletonData ReadSkeletonData (string path) {
 		public override SkeletonData ReadSkeletonData (string path) {
-		#if WINDOWS_PHONE
+#if WINDOWS_PHONE
 			using (var reader = new StreamReader(Microsoft.Xna.Framework.TitleContainer.OpenStream(path))) {
 			using (var reader = new StreamReader(Microsoft.Xna.Framework.TitleContainer.OpenStream(path))) {
-		#else
+#else
 			using (var reader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))) {
 			using (var reader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))) {
-		#endif
+#endif
 				SkeletonData skeletonData = ReadSkeletonData(reader);
 				SkeletonData skeletonData = ReadSkeletonData(reader);
 				skeletonData.name = Path.GetFileNameWithoutExtension(path);
 				skeletonData.name = Path.GetFileNameWithoutExtension(path);
 				return skeletonData;
 				return skeletonData;
 			}
 			}
 		}
 		}
-		#endif
+#endif
 
 
 		public SkeletonData ReadSkeletonData (TextReader reader) {
 		public SkeletonData ReadSkeletonData (TextReader reader) {
 			if (reader == null) throw new ArgumentNullException("reader", "reader cannot be null.");
 			if (reader == null) throw new ArgumentNullException("reader", "reader cannot be null.");
@@ -178,7 +178,7 @@ namespace Spine {
 				foreach (Dictionary<string, Object> constraintMap in (List<Object>)root["ik"]) {
 				foreach (Dictionary<string, Object> constraintMap in (List<Object>)root["ik"]) {
 					IkConstraintData data = new IkConstraintData((string)constraintMap["name"]);
 					IkConstraintData data = new IkConstraintData((string)constraintMap["name"]);
 					data.order = GetInt(constraintMap, "order", 0);
 					data.order = GetInt(constraintMap, "order", 0);
-					data.skinRequired = GetBoolean(constraintMap,"skin", false);
+					data.skinRequired = GetBoolean(constraintMap, "skin", false);
 
 
 					if (constraintMap.ContainsKey("bones")) {
 					if (constraintMap.ContainsKey("bones")) {
 						foreach (string boneName in (List<Object>)constraintMap["bones"]) {
 						foreach (string boneName in (List<Object>)constraintMap["bones"]) {
@@ -207,7 +207,7 @@ namespace Spine {
 				foreach (Dictionary<string, Object> constraintMap in (List<Object>)root["transform"]) {
 				foreach (Dictionary<string, Object> constraintMap in (List<Object>)root["transform"]) {
 					TransformConstraintData data = new TransformConstraintData((string)constraintMap["name"]);
 					TransformConstraintData data = new TransformConstraintData((string)constraintMap["name"]);
 					data.order = GetInt(constraintMap, "order", 0);
 					data.order = GetInt(constraintMap, "order", 0);
-					data.skinRequired = GetBoolean(constraintMap,"skin", false);
+					data.skinRequired = GetBoolean(constraintMap, "skin", false);
 
 
 					if (constraintMap.ContainsKey("bones")) {
 					if (constraintMap.ContainsKey("bones")) {
 						foreach (string boneName in (List<Object>)constraintMap["bones"]) {
 						foreach (string boneName in (List<Object>)constraintMap["bones"]) {
@@ -243,11 +243,11 @@ namespace Spine {
 			}
 			}
 
 
 			// Path constraints.
 			// Path constraints.
-			if(root.ContainsKey("path")) {
+			if (root.ContainsKey("path")) {
 				foreach (Dictionary<string, Object> constraintMap in (List<Object>)root["path"]) {
 				foreach (Dictionary<string, Object> constraintMap in (List<Object>)root["path"]) {
 					PathConstraintData data = new PathConstraintData((string)constraintMap["name"]);
 					PathConstraintData data = new PathConstraintData((string)constraintMap["name"]);
 					data.order = GetInt(constraintMap, "order", 0);
 					data.order = GetInt(constraintMap, "order", 0);
-					data.skinRequired = GetBoolean(constraintMap,"skin", false);
+					data.skinRequired = GetBoolean(constraintMap, "skin", false);
 
 
 					if (constraintMap.ContainsKey("bones")) {
 					if (constraintMap.ContainsKey("bones")) {
 						foreach (string boneName in (List<Object>)constraintMap["bones"]) {
 						foreach (string boneName in (List<Object>)constraintMap["bones"]) {
@@ -418,78 +418,78 @@ namespace Spine {
 				return box;
 				return box;
 			case AttachmentType.Mesh:
 			case AttachmentType.Mesh:
 			case AttachmentType.Linkedmesh: {
 			case AttachmentType.Linkedmesh: {
-					MeshAttachment mesh = attachmentLoader.NewMeshAttachment(skin, name, path);
-					if (mesh == null) return null;
-					mesh.Path = path;
-
-					if (map.ContainsKey("color")) {
-						var color = (string)map["color"];
-						mesh.r = ToColor(color, 0);
-						mesh.g = ToColor(color, 1);
-						mesh.b = ToColor(color, 2);
-						mesh.a = ToColor(color, 3);
-					}
+				MeshAttachment mesh = attachmentLoader.NewMeshAttachment(skin, name, path);
+				if (mesh == null) return null;
+				mesh.Path = path;
 
 
-					mesh.Width = GetFloat(map, "width", 0) * scale;
-					mesh.Height = GetFloat(map, "height", 0) * scale;
-
-					string parent = GetString(map, "parent", null);
-					if (parent != null) {
-						linkedMeshes.Add(new LinkedMesh(mesh, GetString(map, "skin", null), slotIndex, parent, GetBoolean(map, "deform", true)));
-						return mesh;
-					}
+				if (map.ContainsKey("color")) {
+					var color = (string)map["color"];
+					mesh.r = ToColor(color, 0);
+					mesh.g = ToColor(color, 1);
+					mesh.b = ToColor(color, 2);
+					mesh.a = ToColor(color, 3);
+				}
 
 
-					float[] uvs = GetFloatArray(map, "uvs", 1);
-					ReadVertices(map, mesh, uvs.Length);
-					mesh.triangles = GetIntArray(map, "triangles");
-					mesh.regionUVs = uvs;
-					mesh.UpdateUVs();
+				mesh.Width = GetFloat(map, "width", 0) * scale;
+				mesh.Height = GetFloat(map, "height", 0) * scale;
 
 
-					if (map.ContainsKey("hull")) mesh.HullLength = GetInt(map, "hull", 0) << 1;
-					if (map.ContainsKey("edges")) mesh.Edges = GetIntArray(map, "edges");
+				string parent = GetString(map, "parent", null);
+				if (parent != null) {
+					linkedMeshes.Add(new LinkedMesh(mesh, GetString(map, "skin", null), slotIndex, parent, GetBoolean(map, "deform", true)));
 					return mesh;
 					return mesh;
 				}
 				}
+
+				float[] uvs = GetFloatArray(map, "uvs", 1);
+				ReadVertices(map, mesh, uvs.Length);
+				mesh.triangles = GetIntArray(map, "triangles");
+				mesh.regionUVs = uvs;
+				mesh.UpdateUVs();
+
+				if (map.ContainsKey("hull")) mesh.HullLength = GetInt(map, "hull", 0) << 1;
+				if (map.ContainsKey("edges")) mesh.Edges = GetIntArray(map, "edges");
+				return mesh;
+			}
 			case AttachmentType.Path: {
 			case AttachmentType.Path: {
-					PathAttachment pathAttachment = attachmentLoader.NewPathAttachment(skin, name);
-					if (pathAttachment == null) return null;
-					pathAttachment.closed = GetBoolean(map, "closed", false);
-					pathAttachment.constantSpeed = GetBoolean(map, "constantSpeed", true);
+				PathAttachment pathAttachment = attachmentLoader.NewPathAttachment(skin, name);
+				if (pathAttachment == null) return null;
+				pathAttachment.closed = GetBoolean(map, "closed", false);
+				pathAttachment.constantSpeed = GetBoolean(map, "constantSpeed", true);
 
 
-					int vertexCount = GetInt(map, "vertexCount", 0);
-					ReadVertices(map, pathAttachment, vertexCount << 1);
+				int vertexCount = GetInt(map, "vertexCount", 0);
+				ReadVertices(map, pathAttachment, vertexCount << 1);
 
 
-					// potential BOZO see Java impl
-					pathAttachment.lengths = GetFloatArray(map, "lengths", scale);
-					return pathAttachment;
-				}
+				// potential BOZO see Java impl
+				pathAttachment.lengths = GetFloatArray(map, "lengths", scale);
+				return pathAttachment;
+			}
 			case AttachmentType.Point: {
 			case AttachmentType.Point: {
-					PointAttachment point = attachmentLoader.NewPointAttachment(skin, name);
-					if (point == null) return null;
-					point.x = GetFloat(map, "x", 0) * scale;
-					point.y = GetFloat(map, "y", 0) * scale;
-					point.rotation = GetFloat(map, "rotation", 0);
-
-					//string color = GetString(map, "color", null);
-					//if (color != null) point.color = color;
-					return point;
-				}
+				PointAttachment point = attachmentLoader.NewPointAttachment(skin, name);
+				if (point == null) return null;
+				point.x = GetFloat(map, "x", 0) * scale;
+				point.y = GetFloat(map, "y", 0) * scale;
+				point.rotation = GetFloat(map, "rotation", 0);
+
+				//string color = GetString(map, "color", null);
+				//if (color != null) point.color = color;
+				return point;
+			}
 			case AttachmentType.Clipping: {
 			case AttachmentType.Clipping: {
-					ClippingAttachment clip = attachmentLoader.NewClippingAttachment(skin, name);
-					if (clip == null) return null;
-
-					string end = GetString(map, "end", null);
-					if (end != null) {
-						SlotData slot = skeletonData.FindSlot(end);
-						if (slot == null) throw new Exception("Clipping end slot not found: " + end);
-						clip.EndSlot = slot;
-					}
+				ClippingAttachment clip = attachmentLoader.NewClippingAttachment(skin, name);
+				if (clip == null) return null;
+
+				string end = GetString(map, "end", null);
+				if (end != null) {
+					SlotData slot = skeletonData.FindSlot(end);
+					if (slot == null) throw new Exception("Clipping end slot not found: " + end);
+					clip.EndSlot = slot;
+				}
 
 
-					ReadVertices(map, clip, GetInt(map, "vertexCount", 0) << 1);
+				ReadVertices(map, clip, GetInt(map, "vertexCount", 0) << 1);
 
 
-					//string color = GetString(map, "color", null);
-					// if (color != null) clip.color = color;
-					return clip;
-				}
+				//string color = GetString(map, "color", null);
+				// if (color != null) clip.color = color;
+				return clip;
+			}
 			}
 			}
 			return null;
 			return null;
 		}
 		}
@@ -557,7 +557,7 @@ namespace Spine {
 							float g = ToColor(color, 1);
 							float g = ToColor(color, 1);
 							float b = ToColor(color, 2);
 							float b = ToColor(color, 2);
 							float a = ToColor(color, 3);
 							float a = ToColor(color, 3);
-							for (int frame = 0, bezier = 0;; frame++) {
+							for (int frame = 0, bezier = 0; ; frame++) {
 								timeline.SetFrame(frame, time, r, g, b, a);
 								timeline.SetFrame(frame, time, r, g, b, a);
 								if (!keyMapEnumerator.MoveNext()) {
 								if (!keyMapEnumerator.MoveNext()) {
 									timeline.Shrink(bezier);
 									timeline.Shrink(bezier);
@@ -632,7 +632,7 @@ namespace Spine {
 							keyMapEnumerator.MoveNext();
 							keyMapEnumerator.MoveNext();
 							timelines.Add(ReadTimeline(ref keyMapEnumerator, new AlphaTimeline(values.Count, values.Count, slotIndex), 0, 1));
 							timelines.Add(ReadTimeline(ref keyMapEnumerator, new AlphaTimeline(values.Count, values.Count, slotIndex), 0, 1));
 
 
-						}  else if (timelineName == "rgba2") {
+						} else if (timelineName == "rgba2") {
 							var timeline = new RGBA2Timeline(values.Count, values.Count * 7, slotIndex);
 							var timeline = new RGBA2Timeline(values.Count, values.Count * 7, slotIndex);
 
 
 							var keyMapEnumerator = values.GetEnumerator();
 							var keyMapEnumerator = values.GetEnumerator();
@@ -1127,7 +1127,7 @@ namespace Spine {
 			timeline.SetBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
 			timeline.SetBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
 		}
 		}
 
 
-		static float[] GetFloatArray(Dictionary<string, Object> map, string name, float scale) {
+		static float[] GetFloatArray (Dictionary<string, Object> map, string name, float scale) {
 			var list = (List<Object>)map[name];
 			var list = (List<Object>)map[name];
 			var values = new float[list.Count];
 			var values = new float[list.Count];
 			if (scale == 1) {
 			if (scale == 1) {
@@ -1140,7 +1140,7 @@ namespace Spine {
 			return values;
 			return values;
 		}
 		}
 
 
-		static int[] GetIntArray(Dictionary<string, Object> map, string name) {
+		static int[] GetIntArray (Dictionary<string, Object> map, string name) {
 			var list = (List<Object>)map[name];
 			var list = (List<Object>)map[name];
 			var values = new int[list.Count];
 			var values = new int[list.Count];
 			for (int i = 0, n = list.Count; i < n; i++)
 			for (int i = 0, n = list.Count; i < n; i++)
@@ -1148,27 +1148,27 @@ namespace Spine {
 			return values;
 			return values;
 		}
 		}
 
 
-		static float GetFloat(Dictionary<string, Object> map, string name, float defaultValue) {
+		static float GetFloat (Dictionary<string, Object> map, string name, float defaultValue) {
 			if (!map.ContainsKey(name)) return defaultValue;
 			if (!map.ContainsKey(name)) return defaultValue;
 			return (float)map[name];
 			return (float)map[name];
 		}
 		}
 
 
-		static int GetInt(Dictionary<string, Object> map, string name, int defaultValue) {
+		static int GetInt (Dictionary<string, Object> map, string name, int defaultValue) {
 			if (!map.ContainsKey(name)) return defaultValue;
 			if (!map.ContainsKey(name)) return defaultValue;
 			return (int)(float)map[name];
 			return (int)(float)map[name];
 		}
 		}
 
 
-		static bool GetBoolean(Dictionary<string, Object> map, string name, bool defaultValue) {
+		static bool GetBoolean (Dictionary<string, Object> map, string name, bool defaultValue) {
 			if (!map.ContainsKey(name)) return defaultValue;
 			if (!map.ContainsKey(name)) return defaultValue;
 			return (bool)map[name];
 			return (bool)map[name];
 		}
 		}
 
 
-		static string GetString(Dictionary<string, Object> map, string name, string defaultValue) {
+		static string GetString (Dictionary<string, Object> map, string name, string defaultValue) {
 			if (!map.ContainsKey(name)) return defaultValue;
 			if (!map.ContainsKey(name)) return defaultValue;
 			return (string)map[name];
 			return (string)map[name];
 		}
 		}
 
 
-		static float ToColor(string hexString, int colorIndex, int expectedLength = 8) {
+		static float ToColor (string hexString, int colorIndex, int expectedLength = 8) {
 			if (hexString.Length != expectedLength)
 			if (hexString.Length != expectedLength)
 				throw new ArgumentException("Color hexidecimal length must be " + expectedLength + ", recieved: " + hexString, "hexString");
 				throw new ArgumentException("Color hexidecimal length must be " + expectedLength + ", recieved: " + hexString, "hexString");
 			return Convert.ToInt32(hexString.Substring(colorIndex * 2, 2), 16) / (float)255;
 			return Convert.ToInt32(hexString.Substring(colorIndex * 2, 2), 16) / (float)255;

+ 1 - 1
spine-csharp/src/SkeletonLoader.cs

@@ -28,8 +28,8 @@
  *****************************************************************************/
  *****************************************************************************/
 
 
 using System;
 using System;
-using System.IO;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
 
 
 namespace Spine {
 namespace Spine {
 
 

+ 2 - 2
spine-csharp/src/Slot.cs

@@ -62,7 +62,7 @@ namespace Spine {
 		}
 		}
 
 
 		/// <summary>Copy constructor.</summary>
 		/// <summary>Copy constructor.</summary>
-		public Slot(Slot slot, Bone bone) {
+		public Slot (Slot slot, Bone bone) {
 			if (slot == null) throw new ArgumentNullException("slot", "slot cannot be null.");
 			if (slot == null) throw new ArgumentNullException("slot", "slot cannot be null.");
 			if (bone == null) throw new ArgumentNullException("bone", "bone cannot be null.");
 			if (bone == null) throw new ArgumentNullException("bone", "bone cannot be null.");
 			data = slot.data;
 			data = slot.data;
@@ -106,7 +106,7 @@ namespace Spine {
 		/// color tinting.</summary>
 		/// color tinting.</summary>
 		public float A { get { return a; } set { a = value; } }
 		public float A { get { return a; } set { a = value; } }
 
 
-		public void ClampColor() {
+		public void ClampColor () {
 			r = MathUtils.Clamp(r, 0, 1);
 			r = MathUtils.Clamp(r, 0, 1);
 			g = MathUtils.Clamp(g, 0, 1);
 			g = MathUtils.Clamp(g, 0, 1);
 			b = MathUtils.Clamp(b, 0, 1);
 			b = MathUtils.Clamp(b, 0, 1);

+ 1 - 1
spine-csharp/src/SlotData.cs

@@ -62,7 +62,7 @@ namespace Spine {
 		public BlendMode BlendMode { get { return blendMode; } set { blendMode = value; } }
 		public BlendMode BlendMode { get { return blendMode; } set { blendMode = value; } }
 
 
 		public SlotData (int index, String name, BoneData boneData) {
 		public SlotData (int index, String name, BoneData boneData) {
-			if (index < 0) throw new ArgumentException ("index must be >= 0.", "index");
+			if (index < 0) throw new ArgumentException("index must be >= 0.", "index");
 			if (name == null) throw new ArgumentNullException("name", "name cannot be null.");
 			if (name == null) throw new ArgumentNullException("name", "name cannot be null.");
 			if (boneData == null) throw new ArgumentNullException("boneData", "boneData cannot be null.");
 			if (boneData == null) throw new ArgumentNullException("boneData", "boneData cannot be null.");
 			this.index = index;
 			this.index = index;

+ 1 - 1
spine-csharp/src/TransformConstraint.cs

@@ -57,7 +57,7 @@ namespace Spine {
 			mixShearY = data.mixShearY;
 			mixShearY = data.mixShearY;
 			bones = new ExposedList<Bone>();
 			bones = new ExposedList<Bone>();
 			foreach (BoneData boneData in data.bones)
 			foreach (BoneData boneData in data.bones)
-				bones.Add (skeleton.FindBone(boneData.name));
+				bones.Add(skeleton.FindBone(boneData.name));
 
 
 			target = skeleton.FindBone(data.target.name);
 			target = skeleton.FindBone(data.target.name);
 		}
 		}

+ 16 - 16
spine-monogame/example/ExampleGame.cs

@@ -27,10 +27,10 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using System;
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Graphics;
 using Microsoft.Xna.Framework.Graphics;
 using Microsoft.Xna.Framework.Input;
 using Microsoft.Xna.Framework.Input;
+using System;
 
 
 namespace Spine {
 namespace Spine {
 
 
@@ -40,19 +40,19 @@ namespace Spine {
 		private MouseState lastMouseState;
 		private MouseState lastMouseState;
 		protected Boolean mouseClicked = false;
 		protected Boolean mouseClicked = false;
 
 
-		public Screen(Example game) {
+		public Screen (Example game) {
 			this.game = game;
 			this.game = game;
 			skeletonRenderer = new SkeletonRenderer(game.GraphicsDevice);
 			skeletonRenderer = new SkeletonRenderer(game.GraphicsDevice);
 			skeletonRenderer.PremultipliedAlpha = false;
 			skeletonRenderer.PremultipliedAlpha = false;
 		}
 		}
 
 
-		public void UpdateInput() {
+		public void UpdateInput () {
 			MouseState state = Mouse.GetState();
 			MouseState state = Mouse.GetState();
 			mouseClicked = lastMouseState.LeftButton == ButtonState.Pressed && state.LeftButton == ButtonState.Released;
 			mouseClicked = lastMouseState.LeftButton == ButtonState.Pressed && state.LeftButton == ButtonState.Released;
 			lastMouseState = state;
 			lastMouseState = state;
 		}
 		}
 
 
-		public abstract void Render(float deltaTime);
+		public abstract void Render (float deltaTime);
 	}
 	}
 
 
 	/// <summary>
 	/// <summary>
@@ -63,7 +63,7 @@ namespace Spine {
 		Skeleton skeleton;
 		Skeleton skeleton;
 		AnimationState state;
 		AnimationState state;
 
 
-		public RaptorScreen(Example game) : base (game) {
+		public RaptorScreen (Example game) : base(game) {
 			// Load the texture atlas
 			// Load the texture atlas
 			atlas = new Atlas("data/raptor.atlas", new XnaTextureLoader(game.GraphicsDevice));
 			atlas = new Atlas("data/raptor.atlas", new XnaTextureLoader(game.GraphicsDevice));
 
 
@@ -85,7 +85,7 @@ namespace Spine {
 			state.SetAnimation(0, "walk", true);
 			state.SetAnimation(0, "walk", true);
 		}
 		}
 
 
-		public override void Render(float deltaTime) {
+		public override void Render (float deltaTime) {
 			// Update the animation state and apply the animations
 			// Update the animation state and apply the animations
 			// to the skeleton
 			// to the skeleton
 			state.Update(deltaTime);
 			state.Update(deltaTime);
@@ -116,7 +116,7 @@ namespace Spine {
 		Skeleton skeleton;
 		Skeleton skeleton;
 		AnimationState state;
 		AnimationState state;
 
 
-		public TankScreen(Example game) : base(game) {
+		public TankScreen (Example game) : base(game) {
 			// Instantiate and configure the two color tinting effect and
 			// Instantiate and configure the two color tinting effect and
 			// assign it to the skeleton renderer
 			// assign it to the skeleton renderer
 			var twoColorTintEffect = game.Content.Load<Effect>("Content\\SpineEffect");
 			var twoColorTintEffect = game.Content.Load<Effect>("Content\\SpineEffect");
@@ -140,7 +140,7 @@ namespace Spine {
 			state.SetAnimation(0, "shoot", true);
 			state.SetAnimation(0, "shoot", true);
 		}
 		}
 
 
-		public override void Render(float deltaTime) {
+		public override void Render (float deltaTime) {
 			state.Update(deltaTime);
 			state.Update(deltaTime);
 			state.Apply(skeleton);
 			state.Apply(skeleton);
 
 
@@ -169,7 +169,7 @@ namespace Spine {
 		Skeleton skeleton;
 		Skeleton skeleton;
 		AnimationState state;
 		AnimationState state;
 
 
-		public SpineboyScreen(Example game) : base(game) {
+		public SpineboyScreen (Example game) : base(game) {
 			atlas = new Atlas("data/spineboy.atlas", new XnaTextureLoader(game.GraphicsDevice));
 			atlas = new Atlas("data/spineboy.atlas", new XnaTextureLoader(game.GraphicsDevice));
 
 
 			SkeletonBinary binary = new SkeletonBinary(atlas);
 			SkeletonBinary binary = new SkeletonBinary(atlas);
@@ -197,7 +197,7 @@ namespace Spine {
 			state.AddAnimation(0, "run", true, 0);
 			state.AddAnimation(0, "run", true, 0);
 		}
 		}
 
 
-		public override void Render(float deltaTime) {
+		public override void Render (float deltaTime) {
 			state.Update(deltaTime);
 			state.Update(deltaTime);
 			state.Apply(skeleton);
 			state.Apply(skeleton);
 			skeleton.UpdateWorldTransform();
 			skeleton.UpdateWorldTransform();
@@ -223,7 +223,7 @@ namespace Spine {
 		Skeleton skeleton;
 		Skeleton skeleton;
 		AnimationState state;
 		AnimationState state;
 
 
-		public MixAndMatchScreen(Example game) : base(game) {
+		public MixAndMatchScreen (Example game) : base(game) {
 			atlas = new Atlas("data/mix-and-match.atlas", new XnaTextureLoader(game.GraphicsDevice));
 			atlas = new Atlas("data/mix-and-match.atlas", new XnaTextureLoader(game.GraphicsDevice));
 
 
 			SkeletonJson json = new SkeletonJson(atlas);
 			SkeletonJson json = new SkeletonJson(atlas);
@@ -256,7 +256,7 @@ namespace Spine {
 			skeleton.SetSkin(mixAndMatchSkin);
 			skeleton.SetSkin(mixAndMatchSkin);
 		}
 		}
 
 
-		public override void Render(float deltaTime) {
+		public override void Render (float deltaTime) {
 			state.Update(deltaTime);
 			state.Update(deltaTime);
 			state.Apply(skeleton);
 			state.Apply(skeleton);
 			skeleton.UpdateWorldTransform();
 			skeleton.UpdateWorldTransform();
@@ -276,7 +276,7 @@ namespace Spine {
 		GraphicsDeviceManager graphics;
 		GraphicsDeviceManager graphics;
 		public Screen currentScreen;
 		public Screen currentScreen;
 
 
-		public Example() {
+		public Example () {
 			IsMouseVisible = true;
 			IsMouseVisible = true;
 
 
 			graphics = new GraphicsDeviceManager(this);
 			graphics = new GraphicsDeviceManager(this);
@@ -285,15 +285,15 @@ namespace Spine {
 			graphics.PreferredBackBufferHeight = 600;
 			graphics.PreferredBackBufferHeight = 600;
 		}
 		}
 
 
-		protected override void LoadContent() {
+		protected override void LoadContent () {
 			currentScreen = new MixAndMatchScreen(this);
 			currentScreen = new MixAndMatchScreen(this);
 		}
 		}
 
 
-		protected override void Update(GameTime gameTime) {
+		protected override void Update (GameTime gameTime) {
 			currentScreen.UpdateInput();
 			currentScreen.UpdateInput();
 		}
 		}
 
 
-		protected override void Draw(GameTime gameTime) {
+		protected override void Draw (GameTime gameTime) {
 			currentScreen.Render((float)(gameTime.ElapsedGameTime.TotalMilliseconds / 1000.0));
 			currentScreen.Render((float)(gameTime.ElapsedGameTime.TotalMilliseconds / 1000.0));
 		}
 		}
 	}
 	}

+ 7 - 7
spine-monogame/example/ExampleProgram.cs

@@ -30,11 +30,11 @@
 using System;
 using System;
 
 
 namespace Spine {
 namespace Spine {
-    static class ExampleProgram {
-        static void Main (string[] args) {
-            using (Example game = new Example()) {
-                game.Run();
-            }
-        }
-    }
+	static class ExampleProgram {
+		static void Main (string[] args) {
+			using (Example game = new Example()) {
+				game.Run();
+			}
+		}
+	}
 }
 }

+ 4 - 6
spine-unity/Assets/Spine Examples/Other Examples/Animation Tester/SpineAnimationTesterTool.cs

@@ -27,14 +27,12 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
 using Spine;
 using Spine;
 using Spine.Unity;
 using Spine.Unity;
-
+using System.Collections;
+using System.Collections.Generic;
 using System.Text;
 using System.Text;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SpineAnimationTesterTool : MonoBehaviour, IHasSkeletonDataAsset, IHasSkeletonComponent {
 	public class SpineAnimationTesterTool : MonoBehaviour, IHasSkeletonDataAsset, IHasSkeletonComponent {
@@ -48,7 +46,7 @@ namespace Spine.Unity.Examples {
 
 
 		public bool useOverrideAttachmentThreshold = true;
 		public bool useOverrideAttachmentThreshold = true;
 
 
-		[Range(0f,1f)]
+		[Range(0f, 1f)]
 		public float attachmentThreshold = 0.5f;
 		public float attachmentThreshold = 0.5f;
 
 
 		public bool useOverrideDrawOrderThreshold;
 		public bool useOverrideDrawOrderThreshold;

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/AttackSpineboy.cs

@@ -56,7 +56,7 @@ namespace Spine.Unity.Examples {
 				if (currentHealth > 0) {
 				if (currentHealth > 0) {
 					spineboy.AnimationState.SetAnimation(0, hit, false);
 					spineboy.AnimationState.SetAnimation(0, hit, false);
 					spineboy.AnimationState.AddAnimation(0, idle, true, 0);
 					spineboy.AnimationState.AddAnimation(0, idle, true, 0);
-					gauge.fillPercent = (float)currentHealth/(float)maxHealth;
+					gauge.fillPercent = (float)currentHealth / (float)maxHealth;
 					onAttack.Invoke();
 					onAttack.Invoke();
 				} else {
 				} else {
 					if (currentHealth >= 0) {
 					if (currentHealth >= 0) {

+ 4 - 4
spine-unity/Assets/Spine Examples/Scripts/FootSoldierExample.cs

@@ -29,9 +29,9 @@
 
 
 // Contributed by: Mitch Thompson
 // Contributed by: Mitch Thompson
 
 
-using UnityEngine;
-using System.Collections;
 using Spine.Unity;
 using Spine.Unity;
+using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class FootSoldierExample : MonoBehaviour {
 	public class FootSoldierExample : MonoBehaviour {
@@ -81,7 +81,7 @@ namespace Spine.Unity.Examples {
 					skeletonAnimation.AnimationName = moveAnimation;
 					skeletonAnimation.AnimationName = moveAnimation;
 					skeletonAnimation.Skeleton.ScaleX = 1;
 					skeletonAnimation.Skeleton.ScaleX = 1;
 					transform.Translate(moveSpeed * Time.deltaTime, 0, 0);
 					transform.Translate(moveSpeed * Time.deltaTime, 0, 0);
-				} else if(Input.GetKey(leftKey)) {
+				} else if (Input.GetKey(leftKey)) {
 					skeletonAnimation.AnimationName = moveAnimation;
 					skeletonAnimation.AnimationName = moveAnimation;
 					skeletonAnimation.Skeleton.ScaleX = -1;
 					skeletonAnimation.Skeleton.ScaleX = -1;
 					transform.Translate(-moveSpeed * Time.deltaTime, 0, 0);
 					transform.Translate(-moveSpeed * Time.deltaTime, 0, 0);
@@ -91,7 +91,7 @@ namespace Spine.Unity.Examples {
 			}
 			}
 		}
 		}
 
 
-		IEnumerator Blink() {
+		IEnumerator Blink () {
 			while (true) {
 			while (true) {
 				yield return new WaitForSeconds(Random.Range(0.25f, 3f));
 				yield return new WaitForSeconds(Random.Range(0.25f, 3f));
 				skeletonAnimation.Skeleton.SetAttachment(eyesSlot, blinkAttachment);
 				skeletonAnimation.Skeleton.SetAttachment(eyesSlot, blinkAttachment);

+ 24 - 24
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/BasicPlatformerController.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine.Unity;
 using UnityEngine;
 using UnityEngine;
 using UnityEngine.Events;
 using UnityEngine.Events;
-using Spine.Unity;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 
@@ -188,29 +188,29 @@ namespace Spine.Unity.Examples {
 			// When the state changes, notify the animation handle of the new state.
 			// When the state changes, notify the animation handle of the new state.
 			string stateName = null;
 			string stateName = null;
 			switch (currentState) {
 			switch (currentState) {
-				case CharacterState.Idle:
-					stateName = "idle";
-					break;
-				case CharacterState.Walk:
-					stateName = "walk";
-					break;
-				case CharacterState.Run:
-					stateName = "run";
-					break;
-				case CharacterState.Crouch:
-					stateName = "crouch";
-					break;
-				case CharacterState.Rise:
-					stateName = "rise";
-					break;
-				case CharacterState.Fall:
-					stateName = "fall";
-					break;
-				case CharacterState.Attack:
-					stateName = "attack";
-					break;
-				default:
-					break;
+			case CharacterState.Idle:
+				stateName = "idle";
+				break;
+			case CharacterState.Walk:
+				stateName = "walk";
+				break;
+			case CharacterState.Run:
+				stateName = "run";
+				break;
+			case CharacterState.Crouch:
+				stateName = "crouch";
+				break;
+			case CharacterState.Rise:
+				stateName = "rise";
+				break;
+			case CharacterState.Fall:
+				stateName = "fall";
+				break;
+			case CharacterState.Attack:
+				stateName = "attack";
+				break;
+			default:
+				break;
 			}
 			}
 
 
 			animationHandle.PlayAnimationForState(stateName, 0);
 			animationHandle.PlayAnimationForState(stateName, 0);

+ 2 - 2
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/Raptor.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using System.Collections;
 using Spine.Unity;
 using Spine.Unity;
+using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class Raptor : MonoBehaviour {
 	public class Raptor : MonoBehaviour {

+ 3 - 3
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineBeginnerTwo.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using System.Collections;
 using Spine.Unity;
 using Spine.Unity;
+using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SpineBeginnerTwo : MonoBehaviour {
 	public class SpineBeginnerTwo : MonoBehaviour {
@@ -92,7 +92,7 @@ namespace Spine.Unity.Examples {
 				spineAnimationState.AddAnimation(0, idleAnimationName, true, 0);
 				spineAnimationState.AddAnimation(0, idleAnimationName, true, 0);
 				yield return new WaitForSeconds(1f);
 				yield return new WaitForSeconds(1f);
 
 
-				skeleton.ScaleX = -1;		// skeleton allows you to flip the skeleton.
+				skeleton.ScaleX = -1;       // skeleton allows you to flip the skeleton.
 				spineAnimationState.SetAnimation(0, idleTurnAnimationName, false);
 				spineAnimationState.SetAnimation(0, idleTurnAnimationName, false);
 				spineAnimationState.AddAnimation(0, idleAnimationName, true, 0);
 				spineAnimationState.AddAnimation(0, idleAnimationName, true, 0);
 				yield return new WaitForSeconds(0.5f);
 				yield return new WaitForSeconds(0.5f);

+ 2 - 2
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineBlinkPlayer.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using System.Collections;
 using Spine.Unity;
 using Spine.Unity;
+using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SpineBlinkPlayer : MonoBehaviour {
 	public class SpineBlinkPlayer : MonoBehaviour {

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyBeginnerInput.cs

@@ -27,8 +27,8 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using System.Collections;
 using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SpineboyBeginnerInput : MonoBehaviour {
 	public class SpineboyBeginnerInput : MonoBehaviour {

+ 4 - 4
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyBeginnerModel.cs

@@ -27,8 +27,8 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using System.Collections;
 using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	[SelectionBase]
 	[SelectionBase]
@@ -46,7 +46,7 @@ namespace Spine.Unity.Examples {
 		#endregion
 		#endregion
 
 
 		float lastShootTime;
 		float lastShootTime;
-		public event System.Action ShootEvent;	// Lets other scripts know when Spineboy is shooting. Check C# Documentation to learn more about events and delegates.
+		public event System.Action ShootEvent;  // Lets other scripts know when Spineboy is shooting. Check C# Documentation to learn more about events and delegates.
 		public event System.Action StartAimEvent;   // Lets other scripts know when Spineboy is aiming.
 		public event System.Action StartAimEvent;   // Lets other scripts know when Spineboy is aiming.
 		public event System.Action StopAimEvent;   // Lets other scripts know when Spineboy is no longer aiming.
 		public event System.Action StopAimEvent;   // Lets other scripts know when Spineboy is no longer aiming.
 
 
@@ -60,7 +60,7 @@ namespace Spine.Unity.Examples {
 
 
 			if (currentTime - lastShootTime > shootInterval) {
 			if (currentTime - lastShootTime > shootInterval) {
 				lastShootTime = currentTime;
 				lastShootTime = currentTime;
-				if (ShootEvent != null) ShootEvent();	// Fire the "ShootEvent" event.
+				if (ShootEvent != null) ShootEvent();   // Fire the "ShootEvent" event.
 			}
 			}
 		}
 		}
 
 
@@ -88,7 +88,7 @@ namespace Spine.Unity.Examples {
 		#endregion
 		#endregion
 
 
 		IEnumerator JumpRoutine () {
 		IEnumerator JumpRoutine () {
-			if (state == SpineBeginnerBodyState.Jumping) yield break;	// Don't jump when already jumping.
+			if (state == SpineBeginnerBodyState.Jumping) yield break;   // Don't jump when already jumping.
 
 
 			state = SpineBeginnerBodyState.Jumping;
 			state = SpineBeginnerBodyState.Jumping;
 
 

+ 3 - 3
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyBeginnerView.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using System.Collections;
 using Spine.Unity;
 using Spine.Unity;
+using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SpineboyBeginnerView : MonoBehaviour {
 	public class SpineboyBeginnerView : MonoBehaviour {
@@ -70,7 +70,7 @@ namespace Spine.Unity.Examples {
 			if (skeletonAnimation == null) return;
 			if (skeletonAnimation == null) return;
 			if (model == null) return;
 			if (model == null) return;
 
 
-			if ((skeletonAnimation.skeleton.ScaleX < 0) != model.facingLeft) {	// Detect changes in model.facingLeft
+			if ((skeletonAnimation.skeleton.ScaleX < 0) != model.facingLeft) {  // Detect changes in model.facingLeft
 				Turn(model.facingLeft);
 				Turn(model.facingLeft);
 			}
 			}
 
 

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyTargetController.cs

@@ -34,7 +34,7 @@ namespace Spine.Unity.Examples {
 
 
 		public SkeletonAnimation skeletonAnimation;
 		public SkeletonAnimation skeletonAnimation;
 
 
-		[SpineBone(dataField:"skeletonAnimation")]
+		[SpineBone(dataField: "skeletonAnimation")]
 		public string boneName;
 		public string boneName;
 		public Camera cam;
 		public Camera cam;
 
 

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Goblins.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using Spine;
 using Spine;
 using Spine.Unity;
 using Spine.Unity;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class Goblins : MonoBehaviour {
 	public class Goblins : MonoBehaviour {

+ 2 - 2
spine-unity/Assets/Spine Examples/Scripts/HurtFlashEffect.cs

@@ -37,8 +37,8 @@ public class HurtFlashEffect : MonoBehaviour {
 
 
 	public int flashCount = DefaultFlashCount;
 	public int flashCount = DefaultFlashCount;
 	public Color flashColor = Color.white;
 	public Color flashColor = Color.white;
-	[Range(1f/120f, 1f/15f)]
-	public float interval = 1f/60f;
+	[Range(1f / 120f, 1f / 15f)]
+	public float interval = 1f / 60f;
 	public string fillPhaseProperty = "_FillPhase";
 	public string fillPhaseProperty = "_FillPhase";
 	public string fillColorProperty = "_FillColor";
 	public string fillColorProperty = "_FillColor";
 
 

+ 2 - 3
spine-unity/Assets/Spine Examples/Scripts/MecanimAnimationMatchModifier/AnimationMatchModifierAsset.cs

@@ -27,13 +27,12 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine;
+using Spine.Unity;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine;
 
 
-using Spine;
-using Spine.Unity;
-
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 
 	//[CreateAssetMenu(menuName = "Spine/SkeletonData Modifiers/Animation Match", order = 200)]
 	//[CreateAssetMenu(menuName = "Spine/SkeletonData Modifiers/Animation Match", order = 200)]

+ 2 - 3
spine-unity/Assets/Spine Examples/Scripts/Mix and Match Character Customize/EquipSystemExample.cs

@@ -27,12 +27,11 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine.Unity.AttachmentTools;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine;
 
 
-using Spine.Unity.AttachmentTools;
-
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class EquipSystemExample : MonoBehaviour, IHasSkeletonDataAsset {
 	public class EquipSystemExample : MonoBehaviour, IHasSkeletonDataAsset {
 
 
@@ -54,7 +53,7 @@ namespace Spine.Unity.Examples {
 			public string slot;
 			public string slot;
 			[SpineSkin]
 			[SpineSkin]
 			public string templateSkin;
 			public string templateSkin;
-			[SpineAttachment(skinField:"templateSkin")]
+			[SpineAttachment(skinField: "templateSkin")]
 			public string templateAttachment;
 			public string templateAttachment;
 		}
 		}
 
 

+ 2 - 3
spine-unity/Assets/Spine Examples/Scripts/Mix and Match Character Customize/EquipsVisualsComponentExample.cs

@@ -27,12 +27,11 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine.Unity.AttachmentTools;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine;
 
 
-using Spine.Unity.AttachmentTools;
-
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class EquipsVisualsComponentExample : MonoBehaviour {
 	public class EquipsVisualsComponentExample : MonoBehaviour {
 
 
@@ -79,7 +78,7 @@ namespace Spine.Unity.Examples {
 			if (runtimeAtlas)
 			if (runtimeAtlas)
 				Destroy(runtimeAtlas);
 				Destroy(runtimeAtlas);
 			var repackedSkin = collectedSkin.GetRepackedSkin("Repacked skin", skeletonAnimation.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial,
 			var repackedSkin = collectedSkin.GetRepackedSkin("Repacked skin", skeletonAnimation.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial,
-				out runtimeMaterial, out runtimeAtlas, maxAtlasSize : 1024, clearCache: false);
+				out runtimeMaterial, out runtimeAtlas, maxAtlasSize: 1024, clearCache: false);
 			collectedSkin.Clear();
 			collectedSkin.Clear();
 
 
 			// You can optionally clear the textures cache after each ore multiple repack operations are done.
 			// You can optionally clear the textures cache after each ore multiple repack operations are done.

+ 2 - 2
spine-unity/Assets/Spine Examples/Scripts/Mix and Match Character Customize/MixAndMatchSkinsButtonExample.cs

@@ -27,8 +27,8 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using Spine.Unity;
 using Spine.Unity;
+using UnityEngine;
 using UnityEngine.UI;
 using UnityEngine.UI;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
@@ -37,7 +37,7 @@ namespace Spine.Unity.Examples {
 		public SkeletonDataAsset skeletonDataAsset;
 		public SkeletonDataAsset skeletonDataAsset;
 		public MixAndMatchSkinsExample skinsSystem;
 		public MixAndMatchSkinsExample skinsSystem;
 
 
-		[SpineSkin(dataField:"skeletonDataAsset")] public string itemSkin;
+		[SpineSkin(dataField: "skeletonDataAsset")] public string itemSkin;
 		public MixAndMatchSkinsExample.ItemType itemType;
 		public MixAndMatchSkinsExample.ItemType itemType;
 
 
 		void Start () {
 		void Start () {

+ 17 - 17
spine-unity/Assets/Spine Examples/Scripts/Mix and Match Character Customize/MixAndMatchSkinsExample.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine.Unity.AttachmentTools;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine;
-using Spine.Unity.AttachmentTools;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 
@@ -77,7 +77,7 @@ namespace Spine.Unity.Examples {
 			UpdateCombinedSkin();
 			UpdateCombinedSkin();
 		}
 		}
 
 
-		public void NextHairSkin() {
+		public void NextHairSkin () {
 			activeHairIndex = (activeHairIndex + 1) % hairSkins.Length;
 			activeHairIndex = (activeHairIndex + 1) % hairSkins.Length;
 			UpdateCharacterSkin();
 			UpdateCharacterSkin();
 			UpdateCombinedSkin();
 			UpdateCombinedSkin();
@@ -113,22 +113,22 @@ namespace Spine.Unity.Examples {
 			UpdateCombinedSkin();
 			UpdateCombinedSkin();
 		}
 		}
 
 
-		public void Equip(string itemSkin, ItemType itemType) {
+		public void Equip (string itemSkin, ItemType itemType) {
 			switch (itemType) {
 			switch (itemType) {
-				case ItemType.Cloth:
-					clothesSkin = itemSkin;
-					break;
-				case ItemType.Pants:
-					pantsSkin = itemSkin;
-					break;
-				case ItemType.Bag:
-					bagSkin = itemSkin;
-					break;
-				case ItemType.Hat:
-					hatSkin = itemSkin;
-					break;
-				default:
-					break;
+			case ItemType.Cloth:
+				clothesSkin = itemSkin;
+				break;
+			case ItemType.Pants:
+				pantsSkin = itemSkin;
+				break;
+			case ItemType.Bag:
+				bagSkin = itemSkin;
+				break;
+			case ItemType.Hat:
+				hatSkin = itemSkin;
+				break;
+			default:
+				break;
 			}
 			}
 			UpdateCombinedSkin();
 			UpdateCombinedSkin();
 		}
 		}

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/MixAndMatch.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using Spine.Unity.AttachmentTools;
 using Spine.Unity.AttachmentTools;
 using System.Collections;
 using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/MixAndMatchGraphic.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using Spine.Unity.AttachmentTools;
 using Spine.Unity.AttachmentTools;
 using System.Collections;
 using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 

+ 3 - 3
spine-unity/Assets/Spine Examples/Scripts/RaggedySpineboy.cs

@@ -27,16 +27,16 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using System.Collections;
 using Spine.Unity;
 using Spine.Unity;
+using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class RaggedySpineboy : MonoBehaviour {
 	public class RaggedySpineboy : MonoBehaviour {
 
 
 		public LayerMask groundMask;
 		public LayerMask groundMask;
 		public float restoreDuration = 0.5f;
 		public float restoreDuration = 0.5f;
-		public Vector2 launchVelocity = new Vector2(50,100);
+		public Vector2 launchVelocity = new Vector2(50, 100);
 
 
 		Spine.Unity.Examples.SkeletonRagdoll2D ragdoll;
 		Spine.Unity.Examples.SkeletonRagdoll2D ragdoll;
 		Collider2D naturalCollider;
 		Collider2D naturalCollider;

+ 4 - 4
spine-unity/Assets/Spine Examples/Scripts/Sample Components/BoneLocalOverride.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using Spine;
 using Spine;
 using Spine.Unity;
 using Spine.Unity;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class BoneLocalOverride : MonoBehaviour {
 	public class BoneLocalOverride : MonoBehaviour {
@@ -50,7 +50,7 @@ namespace Spine.Unity.Examples {
 		ISkeletonAnimation spineComponent;
 		ISkeletonAnimation spineComponent;
 		Bone bone;
 		Bone bone;
 
 
-		#if UNITY_EDITOR
+#if UNITY_EDITOR
 		void OnValidate () {
 		void OnValidate () {
 			if (Application.isPlaying) return;
 			if (Application.isPlaying) return;
 			spineComponent = spineComponent ?? GetComponent<ISkeletonAnimation>();
 			spineComponent = spineComponent ?? GetComponent<ISkeletonAnimation>();
@@ -58,14 +58,14 @@ namespace Spine.Unity.Examples {
 			if (bone != null) bone.SetToSetupPose();
 			if (bone != null) bone.SetToSetupPose();
 			OverrideLocal(spineComponent);
 			OverrideLocal(spineComponent);
 		}
 		}
-		#endif
+#endif
 
 
 		void Awake () {
 		void Awake () {
 			spineComponent = GetComponent<ISkeletonAnimation>();
 			spineComponent = GetComponent<ISkeletonAnimation>();
 			if (spineComponent == null) { this.enabled = false; return; }
 			if (spineComponent == null) { this.enabled = false; return; }
 			spineComponent.UpdateLocal += OverrideLocal;
 			spineComponent.UpdateLocal += OverrideLocal;
 
 
-			if (bone == null) {	this.enabled = false; return; }
+			if (bone == null) { this.enabled = false; return; }
 		}
 		}
 
 
 		void OverrideLocal (ISkeletonAnimation animated) {
 		void OverrideLocal (ISkeletonAnimation animated) {

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Sample Components/CombinedSkin.cs

@@ -27,10 +27,10 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine.Unity.AttachmentTools;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine;
-using Spine.Unity.AttachmentTools;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class CombinedSkin : MonoBehaviour {
 	public class CombinedSkin : MonoBehaviour {

+ 2 - 2
spine-unity/Assets/Spine Examples/Scripts/Sample Components/Ghost/SkeletonGhost.cs

@@ -29,8 +29,8 @@
 
 
 // Contributed by: Mitch Thompson
 // Contributed by: Mitch Thompson
 
 
-using UnityEngine;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 
@@ -44,7 +44,7 @@ namespace Spine.Unity.Examples {
 		public bool ghostingEnabled = true;
 		public bool ghostingEnabled = true;
 		[Tooltip("The time between invididual ghost pieces being spawned.")]
 		[Tooltip("The time between invididual ghost pieces being spawned.")]
 		[UnityEngine.Serialization.FormerlySerializedAs("spawnRate")]
 		[UnityEngine.Serialization.FormerlySerializedAs("spawnRate")]
-		public float spawnInterval = 1f/30f;
+		public float spawnInterval = 1f / 30f;
 		[Tooltip("Maximum number of ghosts that can exist at a time. If the fade speed is not fast enough, the oldest ghost will immediately disappear to enforce the maximum number.")]
 		[Tooltip("Maximum number of ghosts that can exist at a time. If the fade speed is not fast enough, the oldest ghost will immediately disappear to enforce the maximum number.")]
 		public int maximumGhosts = 10;
 		public int maximumGhosts = 10;
 		public float fadeSpeed = 10;
 		public float fadeSpeed = 10;

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Sample Components/Ghost/SkeletonGhostRenderer.cs

@@ -29,8 +29,8 @@
 
 
 // Contributed by: Mitch Thompson
 // Contributed by: Mitch Thompson
 
 
-using UnityEngine;
 using System.Collections;
 using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SkeletonGhostRenderer : MonoBehaviour {
 	public class SkeletonGhostRenderer : MonoBehaviour {

+ 2 - 2
spine-unity/Assets/Spine Examples/Scripts/Sample Components/Legacy/AtlasRegionAttacher.cs

@@ -27,10 +27,10 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using System.Collections.Generic;
 using Spine;
 using Spine;
 using Spine.Unity.AttachmentTools;
 using Spine.Unity.AttachmentTools;
+using System.Collections.Generic;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	/// <summary>
 	/// <summary>

+ 4 - 4
spine-unity/Assets/Spine Examples/Scripts/Sample Components/Legacy/SpriteAttacher.cs

@@ -29,9 +29,9 @@
 
 
 // Original Contribution by: Mitch Thompson
 // Original Contribution by: Mitch Thompson
 
 
-using UnityEngine;
-using System.Collections.Generic;
 using Spine.Unity.AttachmentTools;
 using Spine.Unity.AttachmentTools;
+using System.Collections.Generic;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SpriteAttacher : MonoBehaviour {
 	public class SpriteAttacher : MonoBehaviour {
@@ -45,7 +45,7 @@ namespace Spine.Unity.Examples {
 		[SpineSlot] public string slot;
 		[SpineSlot] public string slot;
 		#endregion
 		#endregion
 
 
-		#if UNITY_EDITOR
+#if UNITY_EDITOR
 		void OnValidate () {
 		void OnValidate () {
 			var skeletonComponent = GetComponent<ISkeletonComponent>();
 			var skeletonComponent = GetComponent<ISkeletonComponent>();
 			var skeletonRenderer = skeletonComponent as SkeletonRenderer;
 			var skeletonRenderer = skeletonComponent as SkeletonRenderer;
@@ -70,7 +70,7 @@ namespace Spine.Unity.Examples {
 				}
 				}
 			}
 			}
 		}
 		}
-		#endif
+#endif
 
 
 		RegionAttachment attachment;
 		RegionAttachment attachment;
 		Slot spineSlot;
 		Slot spineSlot;

+ 4 - 4
spine-unity/Assets/Spine Examples/Scripts/Sample Components/OutlineSkeletonGraphic.cs

@@ -27,8 +27,8 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using Spine.Unity;
 using Spine.Unity;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 
@@ -38,7 +38,7 @@ namespace Spine.Unity.Examples {
 		public Material materialWithoutOutline;
 		public Material materialWithoutOutline;
 		public Material materialWithOutline;
 		public Material materialWithOutline;
 
 
-		#if UNITY_EDITOR
+#if UNITY_EDITOR
 		void Reset () {
 		void Reset () {
 			skeletonGraphic = GetComponent<SkeletonGraphic>();
 			skeletonGraphic = GetComponent<SkeletonGraphic>();
 
 
@@ -51,7 +51,7 @@ namespace Spine.Unity.Examples {
 				}
 				}
 			}
 			}
 		}
 		}
-		#endif
+#endif
 
 
 		void OnEnable () {
 		void OnEnable () {
 			if (skeletonGraphic == null)
 			if (skeletonGraphic == null)
@@ -62,7 +62,7 @@ namespace Spine.Unity.Examples {
 			skeletonGraphic.material = materialWithOutline;
 			skeletonGraphic.material = materialWithOutline;
 		}
 		}
 
 
-		public void  DisableOutlineRendering () {
+		public void DisableOutlineRendering () {
 			skeletonGraphic.material = materialWithoutOutline;
 			skeletonGraphic.material = materialWithoutOutline;
 		}
 		}
 	}
 	}

+ 6 - 7
spine-unity/Assets/Spine Examples/Scripts/Sample Components/RenderExistingMesh.cs

@@ -31,8 +31,8 @@
 #define NEW_PREFAB_SYSTEM
 #define NEW_PREFAB_SYSTEM
 #endif
 #endif
 
 
-using UnityEngine;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 
@@ -42,8 +42,7 @@ namespace Spine.Unity.Examples {
 	[ExecuteInEditMode]
 	[ExecuteInEditMode]
 #endif
 #endif
 	[RequireComponent(typeof(MeshRenderer)), RequireComponent(typeof(MeshFilter))]
 	[RequireComponent(typeof(MeshRenderer)), RequireComponent(typeof(MeshFilter))]
-	public class RenderExistingMesh : MonoBehaviour
-	{
+	public class RenderExistingMesh : MonoBehaviour {
 		public MeshRenderer referenceRenderer;
 		public MeshRenderer referenceRenderer;
 
 
 		bool updateViaSkeletonCallback = false;
 		bool updateViaSkeletonCallback = false;
@@ -101,21 +100,21 @@ namespace Spine.Unity.Examples {
 			InitializeDict();
 			InitializeDict();
 		}
 		}
 
 
-		#if UNITY_EDITOR
+#if UNITY_EDITOR
 		private void Update () {
 		private void Update () {
 			if (!Application.isPlaying) {
 			if (!Application.isPlaying) {
 				InitializeDict();
 				InitializeDict();
 			}
 			}
 		}
 		}
-		#endif
+#endif
 
 
 		void LateUpdate () {
 		void LateUpdate () {
-			#if UNITY_EDITOR
+#if UNITY_EDITOR
 			if (!Application.isPlaying) {
 			if (!Application.isPlaying) {
 				UpdateMaterials();
 				UpdateMaterials();
 				return;
 				return;
 			}
 			}
-			#endif
+#endif
 
 
 			if (updateViaSkeletonCallback)
 			if (updateViaSkeletonCallback)
 				return;
 				return;

+ 3 - 3
spine-unity/Assets/Spine Examples/Scripts/Sample Components/RootMotionDeltaCompensation.cs

@@ -1,5 +1,5 @@
-using UnityEngine;
-using Spine.Unity;
+using Spine.Unity;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 
@@ -38,7 +38,7 @@ namespace Spine.Unity.Examples {
 				rootMotion.rootMotionTranslateYPerX = 0;
 				rootMotion.rootMotionTranslateYPerX = 0;
 		}
 		}
 
 
-		void AdjustDelta() {
+		void AdjustDelta () {
 			Vector3 toTarget = targetPosition.position - this.transform.position;
 			Vector3 toTarget = targetPosition.position - this.transform.position;
 			rootMotion.AdjustRootMotionToDistance(toTarget, trackIndex, adjustX, adjustY,
 			rootMotion.AdjustRootMotionToDistance(toTarget, trackIndex, adjustX, adjustY,
 				minScaleX, maxScaleX, minScaleY, maxScaleY,
 				minScaleX, maxScaleX, minScaleY, maxScaleY,

+ 1 - 2
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SetRigidbodySolverIterations.cs

@@ -40,8 +40,7 @@ namespace Spine.Unity.Examples {
 	/// will be overwritten by the provided value.
 	/// will be overwritten by the provided value.
 	/// </summary>
 	/// </summary>
 	[DisallowMultipleComponent]
 	[DisallowMultipleComponent]
-	public class SetRigidbodySolverIterations : MonoBehaviour
-	{
+	public class SetRigidbodySolverIterations : MonoBehaviour {
 		public int solverIterations = 30;
 		public int solverIterations = 30;
 
 
 		void Awake () {
 		void Awake () {

+ 2 - 3
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonAnimationMulti/SkeletonAnimationMulti.cs

@@ -27,13 +27,12 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine;
+using Spine.Unity;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine;
 
 
-using Spine;
-using Spine.Unity;
-
 namespace Spine.Unity {
 namespace Spine.Unity {
 
 
 	using Animation = Spine.Animation;
 	using Animation = Spine.Animation;

+ 4 - 4
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonColorInitialize.cs

@@ -27,10 +27,10 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using System.Collections.Generic;
-using UnityEngine;
 using Spine;
 using Spine;
 using Spine.Unity;
 using Spine.Unity;
+using System.Collections.Generic;
+using UnityEngine;
 
 
 namespace Spine.Unity.Prototyping {
 namespace Spine.Unity.Prototyping {
 	/// <summary>
 	/// <summary>
@@ -46,7 +46,7 @@ namespace Spine.Unity.Prototyping {
 			public Color color = Color.white;
 			public Color color = Color.white;
 		}
 		}
 
 
-		#if UNITY_EDITOR
+#if UNITY_EDITOR
 		void OnValidate () {
 		void OnValidate () {
 			var skeletonComponent = GetComponent<ISkeletonComponent>();
 			var skeletonComponent = GetComponent<ISkeletonComponent>();
 			if (skeletonComponent != null) {
 			if (skeletonComponent != null) {
@@ -58,7 +58,7 @@ namespace Spine.Unity.Prototyping {
 			}
 			}
 			ApplySettings();
 			ApplySettings();
 		}
 		}
-		#endif
+#endif
 
 
 		void Start () {
 		void Start () {
 			ApplySettings();
 			ApplySettings();

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonGraphicPlayAnimationAtEvent.cs

@@ -27,8 +27,8 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using Spine.Unity;
 using Spine.Unity;
+using UnityEngine;
 
 
 public class SkeletonGraphicPlayAnimationAtEvent : MonoBehaviour {
 public class SkeletonGraphicPlayAnimationAtEvent : MonoBehaviour {
 
 

+ 2 - 2
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/Editor/SkeletonRagdoll2DInspector.cs

@@ -29,9 +29,9 @@
 
 
 // Contributed by: Mitch Thompson
 // Contributed by: Mitch Thompson
 
 
-using UnityEngine;
 using UnityEditor;
 using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
-	public class SkeletonRagdoll2DInspector {}
+	public class SkeletonRagdoll2DInspector { }
 }
 }

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/Editor/SkeletonRagdollInspector.cs

@@ -29,8 +29,8 @@
 
 
 // Contributed by: Mitch Thompson
 // Contributed by: Mitch Thompson
 
 
-using UnityEngine;
 using UnityEditor;
 using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 

+ 2 - 2
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/SkeletonRagdoll.cs

@@ -29,9 +29,9 @@
 
 
 // Contributed by: Mitch Thompson
 // Contributed by: Mitch Thompson
 
 
-using UnityEngine;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	[RequireComponent(typeof(SkeletonRenderer))]
 	[RequireComponent(typeof(SkeletonRenderer))]
@@ -437,7 +437,7 @@ namespace Spine.Unity.Examples {
 			return colliders;
 			return colliders;
 		}
 		}
 
 
-		public class LayerFieldAttribute : PropertyAttribute {}
+		public class LayerFieldAttribute : PropertyAttribute { }
 	}
 	}
 
 
 }
 }

+ 7 - 7
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/SkeletonRagdoll2D.cs

@@ -33,9 +33,9 @@
 #define HINGE_JOINT_NEW_BEHAVIOUR
 #define HINGE_JOINT_NEW_BEHAVIOUR
 #endif
 #endif
 
 
-using UnityEngine;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	[RequireComponent(typeof(SkeletonRenderer))]
 	[RequireComponent(typeof(SkeletonRenderer))]
@@ -174,7 +174,7 @@ namespace Spine.Unity.Examples {
 
 
 					joint.GetComponent<Rigidbody2D>().mass = joint.connectedBody.mass * massFalloffFactor;
 					joint.GetComponent<Rigidbody2D>().mass = joint.connectedBody.mass * massFalloffFactor;
 
 
-				#if HINGE_JOINT_NEW_BEHAVIOUR
+#if HINGE_JOINT_NEW_BEHAVIOUR
 					float referenceAngle = (rbParent.transform.eulerAngles.z - t.eulerAngles.z + 360f) % 360f;
 					float referenceAngle = (rbParent.transform.eulerAngles.z - t.eulerAngles.z + 360f) % 360f;
 					float minAngle = referenceAngle - rotationLimit;
 					float minAngle = referenceAngle - rotationLimit;
 					float maxAngle = referenceAngle + rotationLimit;
 					float maxAngle = referenceAngle + rotationLimit;
@@ -182,10 +182,10 @@ namespace Spine.Unity.Examples {
 						minAngle -= 360f;
 						minAngle -= 360f;
 						maxAngle -= 360f;
 						maxAngle -= 360f;
 					}
 					}
-				#else
-					float minAngle = - rotationLimit;
+#else
+					float minAngle = -rotationLimit;
 					float maxAngle = rotationLimit;
 					float maxAngle = rotationLimit;
-				#endif
+#endif
 					joint.limits = new JointAngleLimits2D {
 					joint.limits = new JointAngleLimits2D {
 						min = minAngle,
 						min = minAngle,
 						max = maxAngle
 						max = maxAngle
@@ -457,7 +457,7 @@ namespace Spine.Unity.Examples {
 			return new Vector3(flipX ? -1f : 1f, flipY ? -1f : 1f, 1f);
 			return new Vector3(flipX ? -1f : 1f, flipY ? -1f : 1f, 1f);
 		}
 		}
 
 
-		#if UNITY_EDITOR
+#if UNITY_EDITOR
 		void OnDrawGizmosSelected () {
 		void OnDrawGizmosSelected () {
 			if (isActive) {
 			if (isActive) {
 				Gizmos.DrawWireSphere(transform.position, thickness * 1.2f);
 				Gizmos.DrawWireSphere(transform.position, thickness * 1.2f);
@@ -466,7 +466,7 @@ namespace Spine.Unity.Examples {
 				Gizmos.DrawWireSphere(newTransformPos, thickness * 1.2f);
 				Gizmos.DrawWireSphere(newTransformPos, thickness * 1.2f);
 			}
 			}
 		}
 		}
-		#endif
+#endif
 	}
 	}
 
 
 }
 }

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/SkeletonUtilityEyeConstraint.cs

@@ -27,8 +27,8 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using System.Collections;
 using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SkeletonUtilityEyeConstraint : SkeletonUtilityConstraint {
 	public class SkeletonUtilityEyeConstraint : SkeletonUtilityConstraint {

+ 3 - 3
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/SkeletonUtilityGroundConstraint.cs

@@ -35,11 +35,11 @@ using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 
-	#if NEW_PREFAB_SYSTEM
+#if NEW_PREFAB_SYSTEM
 	[ExecuteAlways]
 	[ExecuteAlways]
-	#else
+#else
 	[ExecuteInEditMode]
 	[ExecuteInEditMode]
-	#endif
+#endif
 	[RequireComponent(typeof(SkeletonUtilityBone))]
 	[RequireComponent(typeof(SkeletonUtilityBone))]
 	public class SkeletonUtilityGroundConstraint : SkeletonUtilityConstraint {
 	public class SkeletonUtilityGroundConstraint : SkeletonUtilityConstraint {
 
 

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonUtility Modules/SkeletonUtilityKinematicShadow.cs

@@ -27,8 +27,8 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SlotTintBlackFollower.cs

@@ -27,8 +27,8 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using Spine.Unity;
 using Spine.Unity;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 
 

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SpineEventUnityHandler.cs

@@ -60,7 +60,7 @@ namespace Spine.Unity.Prototyping {
 			var state = animationStateComponent.AnimationState;
 			var state = animationStateComponent.AnimationState;
 			foreach (var ep in events) {
 			foreach (var ep in events) {
 				var eventData = skeletonData.FindEvent(ep.spineEvent);
 				var eventData = skeletonData.FindEvent(ep.spineEvent);
-				ep.eventDelegate = ep.eventDelegate ?? delegate(TrackEntry trackEntry, Event e) { if (e.Data == eventData) ep.unityHandler.Invoke(); };
+				ep.eventDelegate = ep.eventDelegate ?? delegate (TrackEntry trackEntry, Event e) { if (e.Data == eventData) ep.unityHandler.Invoke(); };
 				state.Event += ep.eventDelegate;
 				state.Event += ep.eventDelegate;
 			}
 			}
 		}
 		}

+ 2 - 2
spine-unity/Assets/Spine Examples/Scripts/SpawnFromSkeletonDataExample.cs

@@ -38,7 +38,7 @@ namespace Spine.Unity.Examples {
 		[Range(0, 100)]
 		[Range(0, 100)]
 		public int count = 20;
 		public int count = 20;
 
 
-		[SpineAnimation(dataField:"skeletonDataAsset")]
+		[SpineAnimation(dataField: "skeletonDataAsset")]
 		public string startingAnimation;
 		public string startingAnimation;
 
 
 		IEnumerator Start () {
 		IEnumerator Start () {
@@ -51,7 +51,7 @@ namespace Spine.Unity.Examples {
 				var sa = SkeletonAnimation.NewSkeletonAnimationGameObject(skeletonDataAsset); // Spawn a new SkeletonAnimation GameObject.
 				var sa = SkeletonAnimation.NewSkeletonAnimationGameObject(skeletonDataAsset); // Spawn a new SkeletonAnimation GameObject.
 				DoExtraStuff(sa, spineAnimation); // optional stuff for fun.
 				DoExtraStuff(sa, spineAnimation); // optional stuff for fun.
 				sa.gameObject.name = i.ToString();
 				sa.gameObject.name = i.ToString();
-				yield return new WaitForSeconds(1f/8f);
+				yield return new WaitForSeconds(1f / 8f);
 			}
 			}
 
 
 		}
 		}

+ 2 - 2
spine-unity/Assets/Spine Examples/Scripts/SpineGauge.cs

@@ -27,8 +27,8 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using Spine.Unity;
 using Spine.Unity;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	[ExecuteInEditMode]
 	[ExecuteInEditMode]
@@ -36,7 +36,7 @@ namespace Spine.Unity.Examples {
 	public class SpineGauge : MonoBehaviour {
 	public class SpineGauge : MonoBehaviour {
 
 
 		#region Inspector
 		#region Inspector
-		[Range(0,1)]
+		[Range(0, 1)]
 		public float fillPercent = 0;
 		public float fillPercent = 0;
 		public AnimationReferenceAsset fillAnimation;
 		public AnimationReferenceAsset fillAnimation;
 		#endregion
 		#endregion

+ 3 - 3
spine-unity/Assets/Spine Examples/Scripts/Spineboy.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
 using Spine;
 using Spine;
 using Spine.Unity;
 using Spine.Unity;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class Spineboy : MonoBehaviour {
 	public class Spineboy : MonoBehaviour {
@@ -39,10 +39,10 @@ namespace Spine.Unity.Examples {
 			skeletonAnimation = GetComponent<SkeletonAnimation>(); // Get the SkeletonAnimation component for the GameObject this script is attached to.
 			skeletonAnimation = GetComponent<SkeletonAnimation>(); // Get the SkeletonAnimation component for the GameObject this script is attached to.
 			var animationState = skeletonAnimation.AnimationState;
 			var animationState = skeletonAnimation.AnimationState;
 
 
-			animationState.Event += HandleEvent;; // Call our method any time an animation fires an event.
+			animationState.Event += HandleEvent; ; // Call our method any time an animation fires an event.
 			animationState.End += (entry) => Debug.Log("start: " + entry.TrackIndex); // A lambda can be used for the callback instead of a method.
 			animationState.End += (entry) => Debug.Log("start: " + entry.TrackIndex); // A lambda can be used for the callback instead of a method.
 
 
-			animationState.AddAnimation(0, "jump", false, 2);	// Queue jump to be played on track 0 two seconds after the starting animation.
+			animationState.AddAnimation(0, "jump", false, 2);   // Queue jump to be played on track 0 two seconds after the starting animation.
 			animationState.AddAnimation(0, "run", true, 0); // Queue walk to be looped on track 0 after the jump animation.
 			animationState.AddAnimation(0, "run", true, 0); // Queue walk to be looped on track 0 after the jump animation.
 		}
 		}
 
 

+ 1 - 1
spine-unity/Assets/Spine Examples/Scripts/SpineboyFacialExpression.cs

@@ -39,7 +39,7 @@ namespace Spine.Unity.Examples {
 		[SpineSlot]
 		[SpineSlot]
 		public string eyeSlotName, mouthSlotName;
 		public string eyeSlotName, mouthSlotName;
 
 
-		[SpineAttachment(slotField:"eyeSlotName")]
+		[SpineAttachment(slotField: "eyeSlotName")]
 		public string shockEyeName, normalEyeName;
 		public string shockEyeName, normalEyeName;
 
 
 		[SpineAttachment(slotField: "mouthSlotName")]
 		[SpineAttachment(slotField: "mouthSlotName")]

+ 4 - 5
spine-unity/Assets/Spine Examples/Scripts/SpineboyFootplanter.cs

@@ -27,18 +27,17 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine;
+using Spine.Unity;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine;
 
 
-using Spine;
-using Spine.Unity;
-
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SpineboyFootplanter : MonoBehaviour {
 	public class SpineboyFootplanter : MonoBehaviour {
 
 
 		public float timeScale = 0.5f;
 		public float timeScale = 0.5f;
-		[SpineBone]	public string nearBoneName, farBoneName;
+		[SpineBone] public string nearBoneName, farBoneName;
 
 
 		[Header("Settings")]
 		[Header("Settings")]
 		public Vector2 footSize;
 		public Vector2 footSize;
@@ -147,7 +146,7 @@ namespace Spine.Unity.Examples {
 
 
 			// Default starting positions.
 			// Default starting positions.
 			nearFoot.worldPos = tpos;
 			nearFoot.worldPos = tpos;
-			nearFoot.worldPos .x -= comfyDistance;
+			nearFoot.worldPos.x -= comfyDistance;
 			nearFoot.worldPosPrev = nearFoot.worldPosNext = nearFoot.worldPos;
 			nearFoot.worldPosPrev = nearFoot.worldPosNext = nearFoot.worldPos;
 
 
 			farFoot.worldPos = tpos;
 			farFoot.worldPos = tpos;

+ 2 - 3
spine-unity/Assets/Spine Examples/Scripts/SpineboyPole.cs

@@ -27,11 +27,10 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using System.Collections;
 using Spine.Unity;
 using Spine.Unity;
-
 using Spine.Unity.Examples;
 using Spine.Unity.Examples;
+using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SpineboyPole : MonoBehaviour {
 	public class SpineboyPole : MonoBehaviour {

+ 2 - 3
spine-unity/Assets/Spine Examples/Scripts/SpineboyPoleGraphic.cs

@@ -27,11 +27,10 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using System.Collections;
 using Spine.Unity;
 using Spine.Unity;
-
 using Spine.Unity.Examples;
 using Spine.Unity.Examples;
+using System.Collections;
+using UnityEngine;
 
 
 namespace Spine.Unity.Examples {
 namespace Spine.Unity.Examples {
 	public class SpineboyPoleGraphic : MonoBehaviour {
 	public class SpineboyPoleGraphic : MonoBehaviour {

+ 3 - 4
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/AnimationReferenceAssetEditor.cs

@@ -27,13 +27,12 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using System;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;
-using UnityEngine;
-using UnityEditor;
-
 using System.Reflection;
 using System.Reflection;
-using System;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using Editor = UnityEditor.Editor;
 	using Editor = UnityEditor.Editor;

+ 50 - 52
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs

@@ -29,23 +29,22 @@
 
 
 #define SPINE_SKELETON_MECANIM
 #define SPINE_SKELETON_MECANIM
 
 
- #if (UNITY_2017_4 || UNITY_2018_1_OR_NEWER )
- #define SPINE_UNITY_2018_PREVIEW_API
- #endif
+#if (UNITY_2017_4 || UNITY_2018_1_OR_NEWER)
+#define SPINE_UNITY_2018_PREVIEW_API
+#endif
 
 
 
 
 using System;
 using System;
-using System.Reflection;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Reflection;
 using UnityEditor;
 using UnityEditor;
 using UnityEngine;
 using UnityEngine;
-
 using CompatibilityProblemInfo = Spine.Unity.SkeletonDataCompatibility.CompatibilityProblemInfo;
 using CompatibilityProblemInfo = Spine.Unity.SkeletonDataCompatibility.CompatibilityProblemInfo;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
+	using Animation = Spine.Animation;
 	using Event = UnityEngine.Event;
 	using Event = UnityEngine.Event;
 	using Icons = SpineEditorUtilities.Icons;
 	using Icons = SpineEditorUtilities.Icons;
-	using Animation = Spine.Animation;
 
 
 	[CustomEditor(typeof(SkeletonDataAsset)), CanEditMultipleObjects]
 	[CustomEditor(typeof(SkeletonDataAsset)), CanEditMultipleObjects]
 	public class SkeletonDataAssetInspector : UnityEditor.Editor {
 	public class SkeletonDataAssetInspector : UnityEditor.Editor {
@@ -57,14 +56,14 @@ namespace Spine.Unity.Editor {
 		SerializedProperty atlasAssets, skeletonJSON, scale, fromAnimation, toAnimation, duration, defaultMix;
 		SerializedProperty atlasAssets, skeletonJSON, scale, fromAnimation, toAnimation, duration, defaultMix;
 		SerializedProperty skeletonDataModifiers;
 		SerializedProperty skeletonDataModifiers;
 		SerializedProperty blendModeMaterials;
 		SerializedProperty blendModeMaterials;
-		#if SPINE_TK2D
+#if SPINE_TK2D
 		SerializedProperty spriteCollection;
 		SerializedProperty spriteCollection;
-		#endif
+#endif
 
 
-		#if SPINE_SKELETON_MECANIM
+#if SPINE_SKELETON_MECANIM
 		static bool isMecanimExpanded = false;
 		static bool isMecanimExpanded = false;
 		SerializedProperty controller;
 		SerializedProperty controller;
-		#endif
+#endif
 
 
 		SkeletonDataAsset targetSkeletonDataAsset;
 		SkeletonDataAsset targetSkeletonDataAsset;
 		SkeletonData targetSkeletonData;
 		SkeletonData targetSkeletonData;
@@ -117,17 +116,17 @@ namespace Spine.Unity.Editor {
 			skeletonDataModifiers = serializedObject.FindProperty("skeletonDataModifiers");
 			skeletonDataModifiers = serializedObject.FindProperty("skeletonDataModifiers");
 			blendModeMaterials = serializedObject.FindProperty("blendModeMaterials");
 			blendModeMaterials = serializedObject.FindProperty("blendModeMaterials");
 
 
-			#if SPINE_SKELETON_MECANIM
+#if SPINE_SKELETON_MECANIM
 			controller = serializedObject.FindProperty("controller");
 			controller = serializedObject.FindProperty("controller");
-			#endif
+#endif
 
 
-			#if SPINE_TK2D
+#if SPINE_TK2D
 			if (newAtlasAssets) atlasAssets.isExpanded = false;
 			if (newAtlasAssets) atlasAssets.isExpanded = false;
 			spriteCollection = serializedObject.FindProperty("spriteCollection");
 			spriteCollection = serializedObject.FindProperty("spriteCollection");
-			#else
+#else
 			// Analysis disable once ConvertIfToOrExpression
 			// Analysis disable once ConvertIfToOrExpression
 			if (newAtlasAssets) atlasAssets.isExpanded = true;
 			if (newAtlasAssets) atlasAssets.isExpanded = true;
-			#endif
+#endif
 
 
 			// This handles the case where the managed editor assembly is unloaded before recompilation when code changes.
 			// This handles the case where the managed editor assembly is unloaded before recompilation when code changes.
 			AppDomain.CurrentDomain.DomainUnload -= OnDomainUnload;
 			AppDomain.CurrentDomain.DomainUnload -= OnDomainUnload;
@@ -234,15 +233,15 @@ namespace Spine.Unity.Editor {
 				DrawUnityTools();
 				DrawUnityTools();
 
 
 			} else {
 			} else {
-				#if !SPINE_TK2D
+#if !SPINE_TK2D
 				// Draw Reimport Button
 				// Draw Reimport Button
 				using (new EditorGUI.DisabledGroupScope(skeletonJSON.objectReferenceValue == null)) {
 				using (new EditorGUI.DisabledGroupScope(skeletonJSON.objectReferenceValue == null)) {
 					if (GUILayout.Button(SpineInspectorUtility.TempContent("Attempt Reimport", Icons.warning)))
 					if (GUILayout.Button(SpineInspectorUtility.TempContent("Attempt Reimport", Icons.warning)))
 						DoReimport();
 						DoReimport();
 				}
 				}
-				#else
+#else
 				EditorGUILayout.HelpBox("Couldn't load SkeletonData.", MessageType.Error);
 				EditorGUILayout.HelpBox("Couldn't load SkeletonData.", MessageType.Error);
-				#endif
+#endif
 
 
 				DrawWarningList();
 				DrawWarningList();
 			}
 			}
@@ -295,15 +294,15 @@ namespace Spine.Unity.Editor {
 			// Texture source field.
 			// Texture source field.
 			using (new SpineInspectorUtility.BoxScope()) {
 			using (new SpineInspectorUtility.BoxScope()) {
 				EditorGUILayout.LabelField("Atlas", EditorStyles.boldLabel);
 				EditorGUILayout.LabelField("Atlas", EditorStyles.boldLabel);
-				#if !SPINE_TK2D
+#if !SPINE_TK2D
 				EditorGUILayout.PropertyField(atlasAssets, true);
 				EditorGUILayout.PropertyField(atlasAssets, true);
-				#else
+#else
 				using (new EditorGUI.DisabledGroupScope(spriteCollection.objectReferenceValue != null)) {
 				using (new EditorGUI.DisabledGroupScope(spriteCollection.objectReferenceValue != null)) {
 					EditorGUILayout.PropertyField(atlasAssets, true);
 					EditorGUILayout.PropertyField(atlasAssets, true);
 				}
 				}
 				EditorGUILayout.LabelField("spine-tk2d", EditorStyles.boldLabel);
 				EditorGUILayout.LabelField("spine-tk2d", EditorStyles.boldLabel);
 				EditorGUILayout.PropertyField(spriteCollection, true);
 				EditorGUILayout.PropertyField(spriteCollection, true);
-				#endif
+#endif
 			}
 			}
 
 
 			// Mix settings.
 			// Mix settings.
@@ -362,15 +361,15 @@ namespace Spine.Unity.Editor {
 
 
 		void DrawAtlasAssetsFields () {
 		void DrawAtlasAssetsFields () {
 			EditorGUILayout.LabelField("Atlas", EditorStyles.boldLabel);
 			EditorGUILayout.LabelField("Atlas", EditorStyles.boldLabel);
-			#if !SPINE_TK2D
+#if !SPINE_TK2D
 			EditorGUILayout.PropertyField(atlasAssets, true);
 			EditorGUILayout.PropertyField(atlasAssets, true);
-			#else
+#else
 			using (new EditorGUI.DisabledGroupScope(spriteCollection.objectReferenceValue != null)) {
 			using (new EditorGUI.DisabledGroupScope(spriteCollection.objectReferenceValue != null)) {
 				EditorGUILayout.PropertyField(atlasAssets, true);
 				EditorGUILayout.PropertyField(atlasAssets, true);
 			}
 			}
 			EditorGUILayout.LabelField("spine-tk2d", EditorStyles.boldLabel);
 			EditorGUILayout.LabelField("spine-tk2d", EditorStyles.boldLabel);
 			EditorGUILayout.PropertyField(spriteCollection, true);
 			EditorGUILayout.PropertyField(spriteCollection, true);
-			#endif
+#endif
 
 
 			if (atlasAssets.arraySize == 0)
 			if (atlasAssets.arraySize == 0)
 				EditorGUILayout.HelpBox("AtlasAssets array is empty. Skeleton's attachments will load without being mapped to images.", MessageType.Info);
 				EditorGUILayout.HelpBox("AtlasAssets array is empty. Skeleton's attachments will load without being mapped to images.", MessageType.Info);
@@ -387,8 +386,7 @@ namespace Spine.Unity.Editor {
 			if (hasNulls) {
 			if (hasNulls) {
 				if (targetSkeletonDataAsset.atlasAssets.Length == 1) {
 				if (targetSkeletonDataAsset.atlasAssets.Length == 1) {
 					EditorGUILayout.HelpBox("Atlas array cannot have null entries!", MessageType.None);
 					EditorGUILayout.HelpBox("Atlas array cannot have null entries!", MessageType.None);
-				}
-				else {
+				} else {
 					EditorGUILayout.HelpBox("Atlas array should not have null entries!", MessageType.Error);
 					EditorGUILayout.HelpBox("Atlas array should not have null entries!", MessageType.Error);
 					if (SpineInspectorUtility.CenteredButton(SpineInspectorUtility.TempContent("Remove null entries"))) {
 					if (SpineInspectorUtility.CenteredButton(SpineInspectorUtility.TempContent("Remove null entries"))) {
 						var trimmedAtlasAssets = new List<AtlasAssetBase>();
 						var trimmedAtlasAssets = new List<AtlasAssetBase>();
@@ -539,8 +537,7 @@ namespace Spine.Unity.Editor {
 									if (skin != defaultSkin) {
 									if (skin != defaultSkin) {
 										defaultSkin.GetAttachments(i, slotAttachments);
 										defaultSkin.GetAttachments(i, slotAttachments);
 										defaultSkin.GetAttachments(i, defaultSkinAttachments);
 										defaultSkin.GetAttachments(i, defaultSkinAttachments);
-									}
-									else {
+									} else {
 										defaultSkin.GetAttachments(i, defaultSkinAttachments);
 										defaultSkin.GetAttachments(i, defaultSkinAttachments);
 									}
 									}
 								}
 								}
@@ -580,7 +577,7 @@ namespace Spine.Unity.Editor {
 		}
 		}
 
 
 		void DrawUnityTools () {
 		void DrawUnityTools () {
-			#if SPINE_SKELETON_MECANIM
+#if SPINE_SKELETON_MECANIM
 			using (new SpineInspectorUtility.BoxScope()) {
 			using (new SpineInspectorUtility.BoxScope()) {
 				isMecanimExpanded = EditorGUILayout.Foldout(isMecanimExpanded, SpineInspectorUtility.TempContent("SkeletonMecanim", SpineInspectorUtility.UnityIcon<SceneAsset>()));
 				isMecanimExpanded = EditorGUILayout.Foldout(isMecanimExpanded, SpineInspectorUtility.TempContent("SkeletonMecanim", SpineInspectorUtility.UnityIcon<SceneAsset>()));
 				if (isMecanimExpanded) {
 				if (isMecanimExpanded) {
@@ -609,7 +606,7 @@ namespace Spine.Unity.Editor {
 					}
 					}
 				}
 				}
 			}
 			}
-			#endif
+#endif
 		}
 		}
 
 
 		void DrawWarningList () {
 		void DrawWarningList () {
@@ -632,14 +629,14 @@ namespace Spine.Unity.Editor {
 					else
 					else
 						warnings.Add("Skeleton data file is not a valid Spine JSON or binary file.");
 						warnings.Add("Skeleton data file is not a valid Spine JSON or binary file.");
 				} else {
 				} else {
-					#if SPINE_TK2D
+#if SPINE_TK2D
 					bool searchForSpineAtlasAssets = (compatibilityProblemInfo == null);
 					bool searchForSpineAtlasAssets = (compatibilityProblemInfo == null);
 					bool isSpriteCollectionNull = spriteCollection.objectReferenceValue == null;
 					bool isSpriteCollectionNull = spriteCollection.objectReferenceValue == null;
 					if (!isSpriteCollectionNull) searchForSpineAtlasAssets = false;
 					if (!isSpriteCollectionNull) searchForSpineAtlasAssets = false;
-					#else
+#else
 					// Analysis disable once ConvertToConstant.Local
 					// Analysis disable once ConvertToConstant.Local
 					bool searchForSpineAtlasAssets = (compatibilityProblemInfo == null);
 					bool searchForSpineAtlasAssets = (compatibilityProblemInfo == null);
-					#endif
+#endif
 
 
 					if (searchForSpineAtlasAssets) {
 					if (searchForSpineAtlasAssets) {
 						bool detectedNullAtlasEntry = false;
 						bool detectedNullAtlasEntry = false;
@@ -673,10 +670,10 @@ namespace Spine.Unity.Editor {
 									}
 									}
 								}
 								}
 
 
-								#if SPINE_TK2D
+#if SPINE_TK2D
 								if (missingPaths.Count > 0)
 								if (missingPaths.Count > 0)
 									warnings.Add("Missing regions. SkeletonDataAsset requires tk2DSpriteCollectionData or Spine AtlasAssets.");
 									warnings.Add("Missing regions. SkeletonDataAsset requires tk2DSpriteCollectionData or Spine AtlasAssets.");
-								#endif
+#endif
 							}
 							}
 
 
 							if (missingPaths != null) {
 							if (missingPaths != null) {
@@ -692,7 +689,7 @@ namespace Spine.Unity.Editor {
 		}
 		}
 
 
 		void DoReimport () {
 		void DoReimport () {
-			AssetUtility.ImportSpineContent(new [] { AssetDatabase.GetAssetPath(skeletonJSON.objectReferenceValue) }, null, true);
+			AssetUtility.ImportSpineContent(new[] { AssetDatabase.GetAssetPath(skeletonJSON.objectReferenceValue) }, null, true);
 			preview.Clear();
 			preview.Clear();
 			InitializeEditor();
 			InitializeEditor();
 			EditorUtility.SetDirty(targetSkeletonDataAsset);
 			EditorUtility.SetDirty(targetSkeletonDataAsset);
@@ -702,7 +699,7 @@ namespace Spine.Unity.Editor {
 			EditorPrefs.SetString(LastSkinKey, skinName);
 			EditorPrefs.SetString(LastSkinKey, skinName);
 		}
 		}
 
 
-		bool NoProblems() {
+		bool NoProblems () {
 			return warnings.Count == 0 && compatibilityProblemInfo == null;
 			return warnings.Count == 0 && compatibilityProblemInfo == null;
 		}
 		}
 
 
@@ -760,11 +757,11 @@ namespace Spine.Unity.Editor {
 		Camera PreviewUtilityCamera {
 		Camera PreviewUtilityCamera {
 			get {
 			get {
 				if (previewRenderUtility == null) return null;
 				if (previewRenderUtility == null) return null;
-				#if UNITY_2017_1_OR_NEWER
+#if UNITY_2017_1_OR_NEWER
 				return previewRenderUtility.camera;
 				return previewRenderUtility.camera;
-				#else
+#else
 				return previewRenderUtility.m_Camera;
 				return previewRenderUtility.m_Camera;
-				#endif
+#endif
 			}
 			}
 		}
 		}
 
 
@@ -787,7 +784,8 @@ namespace Spine.Unity.Editor {
 			set { if (IsValid) skeletonAnimation.timeScale = value; }
 			set { if (IsValid) skeletonAnimation.timeScale = value; }
 		}
 		}
 
 
-		public bool IsPlayingAnimation { get {
+		public bool IsPlayingAnimation {
+			get {
 				if (!IsValid) return false;
 				if (!IsValid) return false;
 				var currentTrack = skeletonAnimation.AnimationState.GetCurrent(0);
 				var currentTrack = skeletonAnimation.AnimationState.GetCurrent(0);
 				return currentTrack != null && currentTrack.TimeScale > 0;
 				return currentTrack != null && currentTrack.TimeScale > 0;
@@ -862,7 +860,7 @@ namespace Spine.Unity.Editor {
 
 
 			if (previewGameObject == null) {
 			if (previewGameObject == null) {
 				try {
 				try {
-					previewGameObject = EditorInstantiation.InstantiateSkeletonAnimation(skeletonDataAsset, skinName, useObjectFactory:false).gameObject;
+					previewGameObject = EditorInstantiation.InstantiateSkeletonAnimation(skeletonDataAsset, skinName, useObjectFactory: false).gameObject;
 
 
 					if (previewGameObject != null) {
 					if (previewGameObject != null) {
 						previewGameObject.hideFlags = HideFlags.HideAndDontSave;
 						previewGameObject.hideFlags = HideFlags.HideAndDontSave;
@@ -872,9 +870,9 @@ namespace Spine.Unity.Editor {
 						skeletonAnimation.LateUpdate();
 						skeletonAnimation.LateUpdate();
 						previewGameObject.GetComponent<Renderer>().enabled = false;
 						previewGameObject.GetComponent<Renderer>().enabled = false;
 
 
-						#if SPINE_UNITY_2018_PREVIEW_API
+#if SPINE_UNITY_2018_PREVIEW_API
 						previewRenderUtility.AddSingleGO(previewGameObject);
 						previewRenderUtility.AddSingleGO(previewGameObject);
-						#endif
+#endif
 					}
 					}
 
 
 					if (this.ActiveTrack != null) cameraAdjustEndFrame = EditorApplication.timeSinceStartup + skeletonAnimation.AnimationState.GetCurrent(0).Alpha;
 					if (this.ActiveTrack != null) cameraAdjustEndFrame = EditorApplication.timeSinceStartup + skeletonAnimation.AnimationState.GetCurrent(0).Alpha;
@@ -1002,14 +1000,14 @@ namespace Spine.Unity.Editor {
 			Event current = Event.current;
 			Event current = Event.current;
 			int controlID = GUIUtility.GetControlID(SliderHash, FocusType.Passive);
 			int controlID = GUIUtility.GetControlID(SliderHash, FocusType.Passive);
 			switch (current.GetTypeForControl(controlID)) {
 			switch (current.GetTypeForControl(controlID)) {
-				case EventType.ScrollWheel:
-					if (position.Contains(current.mousePosition)) {
-						cameraOrthoGoal += current.delta.y * 0.06f;
-						cameraOrthoGoal = Mathf.Max(0.01f, cameraOrthoGoal);
-						GUIUtility.hotControl = controlID;
-						current.Use();
-					}
-					break;
+			case EventType.ScrollWheel:
+				if (position.Contains(current.mousePosition)) {
+					cameraOrthoGoal += current.delta.y * 0.06f;
+					cameraOrthoGoal = Mathf.Max(0.01f, cameraOrthoGoal);
+					GUIUtility.hotControl = controlID;
+					current.Use();
+				}
+				break;
 			}
 			}
 		}
 		}
 
 

+ 18 - 18
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineAtlasAssetInspector.cs

@@ -30,12 +30,12 @@
 //#define BAKE_ALL_BUTTON
 //#define BAKE_ALL_BUTTON
 //#define REGION_BAKING_MESH
 //#define REGION_BAKING_MESH
 
 
+using Spine;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Reflection;
 using System.Reflection;
 using UnityEditor;
 using UnityEditor;
 using UnityEngine;
 using UnityEngine;
-using Spine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using Event = UnityEngine.Event;
 	using Event = UnityEngine.Event;
@@ -72,12 +72,12 @@ namespace Spine.Unity.Editor {
 			materials = serializedObject.FindProperty("materials");
 			materials = serializedObject.FindProperty("materials");
 			materials.isExpanded = true;
 			materials.isExpanded = true;
 			atlasAsset = (SpineAtlasAsset)target;
 			atlasAsset = (SpineAtlasAsset)target;
-			#if REGION_BAKING_MESH
+#if REGION_BAKING_MESH
 			UpdateBakedList();
 			UpdateBakedList();
-			#endif
+#endif
 		}
 		}
 
 
-		#if REGION_BAKING_MESH
+#if REGION_BAKING_MESH
 		private List<bool> baked;
 		private List<bool> baked;
 		private List<GameObject> bakedObjects;
 		private List<GameObject> bakedObjects;
 
 
@@ -99,7 +99,7 @@ namespace Spine.Unity.Editor {
 				}
 				}
 			}
 			}
 		}
 		}
-		#endif
+#endif
 
 
 		override public void OnInspectorGUI () {
 		override public void OnInspectorGUI () {
 			if (serializedObject.isEditingMultipleObjects) {
 			if (serializedObject.isEditingMultipleObjects) {
@@ -155,7 +155,7 @@ namespace Spine.Unity.Editor {
 
 
 			EditorGUILayout.Space();
 			EditorGUILayout.Space();
 
 
-			#if REGION_BAKING_MESH
+#if REGION_BAKING_MESH
 			if (atlasFile.objectReferenceValue != null) {
 			if (atlasFile.objectReferenceValue != null) {
 				Atlas atlas = asset.GetAtlas();
 				Atlas atlas = asset.GetAtlas();
 				FieldInfo field = typeof(Atlas).GetField("regions", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.NonPublic);
 				FieldInfo field = typeof(Atlas).GetField("regions", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.NonPublic);
@@ -219,7 +219,7 @@ namespace Spine.Unity.Editor {
 				}
 				}
 				EditorGUI.indentLevel--;
 				EditorGUI.indentLevel--;
 
 
-				#if BAKE_ALL_BUTTON
+#if BAKE_ALL_BUTTON
 				// Check state
 				// Check state
 				bool allBaked = true;
 				bool allBaked = true;
 				bool allUnbaked = true;
 				bool allUnbaked = true;
@@ -258,10 +258,10 @@ namespace Spine.Unity.Editor {
 					}
 					}
 
 
 				}
 				}
-				#endif
+#endif
 
 
 			}
 			}
-			#else
+#else
 			if (atlasFile.objectReferenceValue != null) {
 			if (atlasFile.objectReferenceValue != null) {
 
 
 
 
@@ -306,7 +306,7 @@ namespace Spine.Unity.Editor {
 				}
 				}
 				EditorGUI.indentLevel = baseIndent;
 				EditorGUI.indentLevel = baseIndent;
 			}
 			}
-			#endif
+#endif
 
 
 			if (serializedObject.ApplyModifiedProperties() || SpineInspectorUtility.UndoRedoPerformed(Event.current))
 			if (serializedObject.ApplyModifiedProperties() || SpineInspectorUtility.UndoRedoPerformed(Event.current))
 				atlasAsset.Clear();
 				atlasAsset.Clear();
@@ -320,7 +320,7 @@ namespace Spine.Unity.Editor {
 			var sprites = new List<SpriteMetaData>(spriteSheet);
 			var sprites = new List<SpriteMetaData>(spriteSheet);
 
 
 			var regions = SpineAtlasAssetInspector.GetRegions(atlas);
 			var regions = SpineAtlasAssetInspector.GetRegions(atlas);
-			char[] FilenameDelimiter = {'.'};
+			char[] FilenameDelimiter = { '.' };
 			int updatedCount = 0;
 			int updatedCount = 0;
 			int addedCount = 0;
 			int addedCount = 0;
 
 
@@ -329,13 +329,13 @@ namespace Spine.Unity.Editor {
 				string textureName = texture.name;
 				string textureName = texture.name;
 				bool pageMatch = string.Equals(pageName, textureName, StringComparison.Ordinal);
 				bool pageMatch = string.Equals(pageName, textureName, StringComparison.Ordinal);
 
 
-//				if (pageMatch) {
-//					int pw = r.page.width;
-//					int ph = r.page.height;
-//					bool mismatchSize = pw != texture.width || pw > t.maxTextureSize || ph != texture.height || ph > t.maxTextureSize;
-//					if (mismatchSize)
-//						Debug.LogWarningFormat("Size mismatch found.\nExpected atlas size is {0}x{1}. Texture Import Max Size of texture '{2}'({4}x{5}) is currently set to {3}.", pw, ph, texture.name, t.maxTextureSize, texture.width, texture.height);
-//				}
+				//				if (pageMatch) {
+				//					int pw = r.page.width;
+				//					int ph = r.page.height;
+				//					bool mismatchSize = pw != texture.width || pw > t.maxTextureSize || ph != texture.height || ph > t.maxTextureSize;
+				//					if (mismatchSize)
+				//						Debug.LogWarningFormat("Size mismatch found.\nExpected atlas size is {0}x{1}. Texture Import Max Size of texture '{2}'({4}x{5}) is currently set to {3}.", pw, ph, texture.name, t.maxTextureSize, texture.width, texture.height);
+				//				}
 
 
 				int spriteIndex = pageMatch ? sprites.FindIndex(
 				int spriteIndex = pageMatch ? sprites.FindIndex(
 					(s) => string.Equals(s.name, r.name, StringComparison.Ordinal)
 					(s) => string.Equals(s.name, r.name, StringComparison.Ordinal)

+ 1 - 1
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineSpriteAtlasAssetInspector.cs

@@ -27,12 +27,12 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Reflection;
 using System.Reflection;
 using UnityEditor;
 using UnityEditor;
 using UnityEngine;
 using UnityEngine;
-using Spine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using Event = UnityEngine.Event;
 	using Event = UnityEngine.Event;

+ 4 - 4
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerGraphicInspector.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using UnityEditor;
 using Spine.Unity;
 using Spine.Unity;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 
 
@@ -45,7 +45,7 @@ namespace Spine.Unity.Editor {
 		bool needsReset;
 		bool needsReset;
 
 
 		#region Context Menu Item
 		#region Context Menu Item
-		[MenuItem ("CONTEXT/SkeletonGraphic/Add BoneFollower GameObject")]
+		[MenuItem("CONTEXT/SkeletonGraphic/Add BoneFollower GameObject")]
 		static void AddBoneFollowerGameObject (MenuCommand cmd) {
 		static void AddBoneFollowerGameObject (MenuCommand cmd) {
 			var skeletonGraphic = cmd.context as SkeletonGraphic;
 			var skeletonGraphic = cmd.context as SkeletonGraphic;
 			var go = EditorInstantiation.NewGameObject("BoneFollower", true, typeof(RectTransform));
 			var go = EditorInstantiation.NewGameObject("BoneFollower", true, typeof(RectTransform));
@@ -63,7 +63,7 @@ namespace Spine.Unity.Editor {
 		}
 		}
 
 
 		// Validate
 		// Validate
-		[MenuItem ("CONTEXT/SkeletonGraphic/Add BoneFollower GameObject", true)]
+		[MenuItem("CONTEXT/SkeletonGraphic/Add BoneFollower GameObject", true)]
 		static bool ValidateAddBoneFollowerGameObject (MenuCommand cmd) {
 		static bool ValidateAddBoneFollowerGameObject (MenuCommand cmd) {
 			var skeletonGraphic = cmd.context as SkeletonGraphic;
 			var skeletonGraphic = cmd.context as SkeletonGraphic;
 			return skeletonGraphic.IsValid;
 			return skeletonGraphic.IsValid;

+ 2 - 2
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerInspector.cs

@@ -43,7 +43,7 @@ namespace Spine.Unity.Editor {
 		bool needsReset;
 		bool needsReset;
 
 
 		#region Context Menu Item
 		#region Context Menu Item
-		[MenuItem ("CONTEXT/SkeletonRenderer/Add BoneFollower GameObject")]
+		[MenuItem("CONTEXT/SkeletonRenderer/Add BoneFollower GameObject")]
 		static void AddBoneFollowerGameObject (MenuCommand cmd) {
 		static void AddBoneFollowerGameObject (MenuCommand cmd) {
 			var skeletonRenderer = cmd.context as SkeletonRenderer;
 			var skeletonRenderer = cmd.context as SkeletonRenderer;
 			var go = EditorInstantiation.NewGameObject("New BoneFollower", true);
 			var go = EditorInstantiation.NewGameObject("New BoneFollower", true);
@@ -60,7 +60,7 @@ namespace Spine.Unity.Editor {
 		}
 		}
 
 
 		// Validate
 		// Validate
-		[MenuItem ("CONTEXT/SkeletonRenderer/Add BoneFollower GameObject", true)]
+		[MenuItem("CONTEXT/SkeletonRenderer/Add BoneFollower GameObject", true)]
 		static bool ValidateAddBoneFollowerGameObject (MenuCommand cmd) {
 		static bool ValidateAddBoneFollowerGameObject (MenuCommand cmd) {
 			var skeletonRenderer = cmd.context as SkeletonRenderer;
 			var skeletonRenderer = cmd.context as SkeletonRenderer;
 			return skeletonRenderer.valid;
 			return skeletonRenderer.valid;

+ 7 - 7
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerGraphicInspector.cs

@@ -31,9 +31,9 @@
 #define NEW_PREFAB_SYSTEM
 #define NEW_PREFAB_SYSTEM
 #endif
 #endif
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using Event = UnityEngine.Event;
 	using Event = UnityEngine.Event;
@@ -66,11 +66,11 @@ namespace Spine.Unity.Editor {
 
 
 		public override void OnInspectorGUI () {
 		public override void OnInspectorGUI () {
 
 
-			#if !NEW_PREFAB_SYSTEM
+#if !NEW_PREFAB_SYSTEM
 			bool isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);
 			bool isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);
-			#else
+#else
 			bool isInspectingPrefab = false;
 			bool isInspectingPrefab = false;
-			#endif
+#endif
 
 
 			// Note: when calling InitializeEditor() in OnEnable, it throws exception
 			// Note: when calling InitializeEditor() in OnEnable, it throws exception
 			// "SerializedObjectNotCreatableException: Object at index 0 is null".
 			// "SerializedObjectNotCreatableException: Object at index 0 is null".
@@ -109,10 +109,10 @@ namespace Spine.Unity.Editor {
 			if (EditorGUI.EndChangeCheck()) {
 			if (EditorGUI.EndChangeCheck()) {
 				serializedObject.ApplyModifiedProperties();
 				serializedObject.ApplyModifiedProperties();
 				InitializeEditor();
 				InitializeEditor();
-				#if !NEW_PREFAB_SYSTEM
+#if !NEW_PREFAB_SYSTEM
 				if (!isInspectingPrefab)
 				if (!isInspectingPrefab)
 					rebuildRequired = true;
 					rebuildRequired = true;
-				#endif
+#endif
 			}
 			}
 
 
 			using (new SpineInspectorUtility.LabelWidthScope(150f)) {
 			using (new SpineInspectorUtility.LabelWidthScope(150f)) {

+ 7 - 7
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerInspector.cs

@@ -31,9 +31,9 @@
 #define NEW_PREFAB_SYSTEM
 #define NEW_PREFAB_SYSTEM
 #endif
 #endif
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using Event = UnityEngine.Event;
 	using Event = UnityEngine.Event;
@@ -66,11 +66,11 @@ namespace Spine.Unity.Editor {
 
 
 		public override void OnInspectorGUI () {
 		public override void OnInspectorGUI () {
 
 
-			#if !NEW_PREFAB_SYSTEM
+#if !NEW_PREFAB_SYSTEM
 			bool isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);
 			bool isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab);
-			#else
+#else
 			bool isInspectingPrefab = false;
 			bool isInspectingPrefab = false;
-			#endif
+#endif
 
 
 			// Note: when calling InitializeEditor() in OnEnable, it throws exception
 			// Note: when calling InitializeEditor() in OnEnable, it throws exception
 			// "SerializedObjectNotCreatableException: Object at index 0 is null".
 			// "SerializedObjectNotCreatableException: Object at index 0 is null".
@@ -109,10 +109,10 @@ namespace Spine.Unity.Editor {
 			if (EditorGUI.EndChangeCheck()) {
 			if (EditorGUI.EndChangeCheck()) {
 				serializedObject.ApplyModifiedProperties();
 				serializedObject.ApplyModifiedProperties();
 				InitializeEditor();
 				InitializeEditor();
-				#if !NEW_PREFAB_SYSTEM
+#if !NEW_PREFAB_SYSTEM
 				if (!isInspectingPrefab)
 				if (!isInspectingPrefab)
 					rebuildRequired = true;
 					rebuildRequired = true;
-				#endif
+#endif
 			}
 			}
 
 
 			using (new SpineInspectorUtility.LabelWidthScope(150f)) {
 			using (new SpineInspectorUtility.LabelWidthScope(150f)) {

+ 1 - 1
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonAnimationInspector.cs

@@ -27,9 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine;
 using UnityEditor;
 using UnityEditor;
 using UnityEngine;
 using UnityEngine;
-using Spine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 
 

+ 1 - 1
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicCustomMaterialsInspector.cs

@@ -27,13 +27,13 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
+using Spine.Unity.Examples;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
 using UnityEditor;
 using UnityEditor;
 using UnityEngine;
 using UnityEngine;
-using Spine.Unity.Examples;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 
 

+ 11 - 15
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicInspector.cs

@@ -31,8 +31,8 @@
 #define NEW_PREFAB_SYSTEM
 #define NEW_PREFAB_SYSTEM
 #endif
 #endif
 
 
-using UnityEngine;
 using UnityEditor;
 using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using Icons = SpineEditorUtilities.Icons;
 	using Icons = SpineEditorUtilities.Icons;
@@ -71,8 +71,7 @@ namespace Spine.Unity.Editor {
 							return false;
 							return false;
 					}
 					}
 					return true;
 					return true;
-				}
-				else {
+				} else {
 					var component = (SkeletonGraphic)target;
 					var component = (SkeletonGraphic)target;
 					return component.IsValid;
 					return component.IsValid;
 				}
 				}
@@ -136,8 +135,7 @@ namespace Spine.Unity.Editor {
 					foreach (var c in targets) {
 					foreach (var c in targets) {
 						SpineEditorUtilities.ReloadSkeletonDataAssetAndComponent(c as SkeletonGraphic);
 						SpineEditorUtilities.ReloadSkeletonDataAssetAndComponent(c as SkeletonGraphic);
 					}
 					}
-				}
-				else {
+				} else {
 					foreach (var c in targets) {
 					foreach (var c in targets) {
 						var component = c as SkeletonGraphic;
 						var component = c as SkeletonGraphic;
 						if (!component.IsValid) {
 						if (!component.IsValid) {
@@ -243,8 +241,7 @@ namespace Spine.Unity.Editor {
 								meshGeneratorSettings.isExpanded = true;
 								meshGeneratorSettings.isExpanded = true;
 								EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("'Multiple Canvas Renderers' must be enabled\nwhen 'Enable Separation' is enabled.", Icons.warning), GUILayout.Height(42), GUILayout.Width(340));
 								EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("'Multiple Canvas Renderers' must be enabled\nwhen 'Enable Separation' is enabled.", Icons.warning), GUILayout.Height(42), GUILayout.Width(340));
 							}
 							}
-						}
-						else if (meshRendersIncorrectlyWithSingleRenderer) {
+						} else if (meshRendersIncorrectlyWithSingleRenderer) {
 							using (new SpineInspectorUtility.BoxScope()) {
 							using (new SpineInspectorUtility.BoxScope()) {
 								meshGeneratorSettings.isExpanded = true;
 								meshGeneratorSettings.isExpanded = true;
 								EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("This mesh uses multiple atlas pages. You\n" +
 								EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("This mesh uses multiple atlas pages. You\n" +
@@ -298,12 +295,12 @@ namespace Spine.Unity.Editor {
 			if (TargetIsValid && !isInspectingPrefab) {
 			if (TargetIsValid && !isInspectingPrefab) {
 				EditorGUILayout.Space();
 				EditorGUILayout.Space();
 				if (SpineInspectorUtility.CenteredButton(new GUIContent("Add Skeleton Utility", Icons.skeletonUtility), 21, true, 200f))
 				if (SpineInspectorUtility.CenteredButton(new GUIContent("Add Skeleton Utility", Icons.skeletonUtility), 21, true, 200f))
-				foreach (var t in targets) {
-					var component = t as Component;
-					if (component.GetComponent<SkeletonUtility>() == null) {
-						component.gameObject.AddComponent<SkeletonUtility>();
+					foreach (var t in targets) {
+						var component = t as Component;
+						if (component.GetComponent<SkeletonUtility>() == null) {
+							component.gameObject.AddComponent<SkeletonUtility>();
+						}
 					}
 					}
-				}
 			}
 			}
 
 
 			wasChanged |= EditorGUI.EndChangeCheck();
 			wasChanged |= EditorGUI.EndChangeCheck();
@@ -384,12 +381,11 @@ namespace Spine.Unity.Editor {
 						separatorSlotNames.arraySize++;
 						separatorSlotNames.arraySize++;
 					}
 					}
 					GUILayout.EndHorizontal();
 					GUILayout.EndHorizontal();
-				}
-				else
+				} else
 					EditorGUILayout.PropertyField(separatorSlotNames, new GUIContent(separatorSlotNames.displayName + string.Format("{0} [{1}]", terminalSlotWarning, separatorSlotNames.arraySize), SeparatorsDescription), true);
 					EditorGUILayout.PropertyField(separatorSlotNames, new GUIContent(separatorSlotNames.displayName + string.Format("{0} [{1}]", terminalSlotWarning, separatorSlotNames.arraySize), SeparatorsDescription), true);
 
 
 				EditorGUILayout.PropertyField(enableSeparatorSlots, SpineInspectorUtility.TempContent("Enable Separation", tooltip: "Whether to enable separation at the above separator slots."));
 				EditorGUILayout.PropertyField(enableSeparatorSlots, SpineInspectorUtility.TempContent("Enable Separation", tooltip: "Whether to enable separation at the above separator slots."));
-				EditorGUILayout.PropertyField(updateSeparatorPartLocation, SpineInspectorUtility.TempContent("Update Part Location", tooltip:"Update separator part GameObject location to match the position of the SkeletonGraphic. This can be helpful when re-parenting parts to a different GameObject."));
+				EditorGUILayout.PropertyField(updateSeparatorPartLocation, SpineInspectorUtility.TempContent("Update Part Location", tooltip: "Update separator part GameObject location to match the position of the SkeletonGraphic. This can be helpful when re-parenting parts to a different GameObject."));
 			}
 			}
 		}
 		}
 
 

+ 3 - 3
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererCustomMaterialsInspector.cs

@@ -31,13 +31,13 @@
 
 
 // Contributed by: Lost Polygon
 // Contributed by: Lost Polygon
 
 
+using Spine.Unity.Examples;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
 using UnityEditor;
 using UnityEditor;
 using UnityEngine;
 using UnityEngine;
-using Spine.Unity.Examples;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 
 
@@ -137,9 +137,9 @@ namespace Spine.Unity.Editor {
 
 
 			if (SpineInspectorUtility.LargeCenteredButton(SpineInspectorUtility.TempContent("Clear and Reapply Changes", tooltip: "Removes all non-serialized overrides in the SkeletonRenderer and reapplies the overrides on this component."))) {
 			if (SpineInspectorUtility.LargeCenteredButton(SpineInspectorUtility.TempContent("Clear and Reapply Changes", tooltip: "Removes all non-serialized overrides in the SkeletonRenderer and reapplies the overrides on this component."))) {
 				if (skeletonRenderer != null) {
 				if (skeletonRenderer != null) {
-					#if SPINE_OPTIONAL_MATERIALOVERRIDE
+#if SPINE_OPTIONAL_MATERIALOVERRIDE
 					skeletonRenderer.CustomMaterialOverride.Clear();
 					skeletonRenderer.CustomMaterialOverride.Clear();
-					#endif
+#endif
 					skeletonRenderer.CustomSlotMaterials.Clear();
 					skeletonRenderer.CustomSlotMaterials.Clear();
 					RemoveCustomMaterials();
 					RemoveCustomMaterials();
 					SetCustomMaterials();
 					SetCustomMaterials();

+ 23 - 24
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererInspector.cs

@@ -45,10 +45,10 @@
 #define HAS_ON_POSTPROCESS_PREFAB
 #define HAS_ON_POSTPROCESS_PREFAB
 #endif
 #endif
 
 
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
-using UnityEngine;
 using System.Reflection;
 using System.Reflection;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using Event = UnityEngine.Event;
 	using Event = UnityEngine.Event;
@@ -216,7 +216,7 @@ namespace Spine.Unity.Editor {
 					}
 					}
 				}
 				}
 
 
-				#if BUILT_IN_SPRITE_MASK_COMPONENT
+#if BUILT_IN_SPRITE_MASK_COMPONENT
 				if (setMaskNoneMaterialsQueued) {
 				if (setMaskNoneMaterialsQueued) {
 					setMaskNoneMaterialsQueued = false;
 					setMaskNoneMaterialsQueued = false;
 					foreach (var c in targets)
 					foreach (var c in targets)
@@ -243,7 +243,7 @@ namespace Spine.Unity.Editor {
 					foreach (var c in targets)
 					foreach (var c in targets)
 						EditorDeleteMaskMaterials(c as SkeletonRenderer, SpriteMaskInteraction.VisibleOutsideMask);
 						EditorDeleteMaskMaterials(c as SkeletonRenderer, SpriteMaskInteraction.VisibleOutsideMask);
 				}
 				}
-				#endif
+#endif
 
 
 #if NO_PREFAB_MESH
 #if NO_PREFAB_MESH
 				if (isInspectingPrefab) {
 				if (isInspectingPrefab) {
@@ -342,17 +342,17 @@ namespace Spine.Unity.Editor {
 							if (updateWhenInvisible != null) EditorGUILayout.PropertyField(updateWhenInvisible, UpdateWhenInvisibleLabel);
 							if (updateWhenInvisible != null) EditorGUILayout.PropertyField(updateWhenInvisible, UpdateWhenInvisibleLabel);
 
 
 							if (singleSubmesh != null) EditorGUILayout.PropertyField(singleSubmesh, SingleSubmeshLabel);
 							if (singleSubmesh != null) EditorGUILayout.PropertyField(singleSubmesh, SingleSubmeshLabel);
-							#if PER_MATERIAL_PROPERTY_BLOCKS
+#if PER_MATERIAL_PROPERTY_BLOCKS
 							if (fixDrawOrder != null) EditorGUILayout.PropertyField(fixDrawOrder, FixDrawOrderLabel);
 							if (fixDrawOrder != null) EditorGUILayout.PropertyField(fixDrawOrder, FixDrawOrderLabel);
-							#endif
+#endif
 							if (immutableTriangles != null) EditorGUILayout.PropertyField(immutableTriangles, ImmubleTrianglesLabel);
 							if (immutableTriangles != null) EditorGUILayout.PropertyField(immutableTriangles, ImmubleTrianglesLabel);
 							EditorGUILayout.PropertyField(clearStateOnDisable, ClearStateOnDisableLabel);
 							EditorGUILayout.PropertyField(clearStateOnDisable, ClearStateOnDisableLabel);
 							EditorGUILayout.Space();
 							EditorGUILayout.Space();
 
 
-						#if HAS_ON_POSTPROCESS_PREFAB
+#if HAS_ON_POSTPROCESS_PREFAB
 							if (fixPrefabOverrideViaMeshFilter != null) EditorGUILayout.PropertyField(fixPrefabOverrideViaMeshFilter, FixPrefabOverrideViaMeshFilterLabel);
 							if (fixPrefabOverrideViaMeshFilter != null) EditorGUILayout.PropertyField(fixPrefabOverrideViaMeshFilter, FixPrefabOverrideViaMeshFilterLabel);
 							EditorGUILayout.Space();
 							EditorGUILayout.Space();
-						#endif
+#endif
 						}
 						}
 
 
 						SeparatorsField(separatorSlotNames);
 						SeparatorsField(separatorSlotNames);
@@ -374,7 +374,7 @@ namespace Spine.Unity.Editor {
 							if (tangents != null) EditorGUILayout.PropertyField(tangents, TangentsLabel);
 							if (tangents != null) EditorGUILayout.PropertyField(tangents, TangentsLabel);
 						}
 						}
 
 
-						#if BUILT_IN_SPRITE_MASK_COMPONENT
+#if BUILT_IN_SPRITE_MASK_COMPONENT
 						EditorGUILayout.Space();
 						EditorGUILayout.Space();
 						if (maskMaterialsNone.arraySize > 0 || maskMaterialsInside.arraySize > 0 || maskMaterialsOutside.arraySize > 0) {
 						if (maskMaterialsNone.arraySize > 0 || maskMaterialsInside.arraySize > 0 || maskMaterialsOutside.arraySize > 0) {
 							EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Mask Interaction Materials", SpineInspectorUtility.UnityIcon<SpriteMask>()), EditorStyles.boldLabel);
 							EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Mask Interaction Materials", SpineInspectorUtility.UnityIcon<SpriteMask>()), EditorStyles.boldLabel);
@@ -389,7 +389,7 @@ namespace Spine.Unity.Editor {
 							MaskMaterialsEditingField(ref setOutsideMaskMaterialsQueued, ref deleteOutsideMaskMaterialsQueued, maskMaterialsOutside, MaskMaterialsOutsideLabel,
 							MaskMaterialsEditingField(ref setOutsideMaskMaterialsQueued, ref deleteOutsideMaskMaterialsQueued, maskMaterialsOutside, MaskMaterialsOutsideLabel,
 														differentMaskModesSelected, allowDelete : true, isActiveMaterial: activeMaskInteractionValue == (int)SpriteMaskInteraction.VisibleOutsideMask);
 														differentMaskModesSelected, allowDelete : true, isActiveMaterial: activeMaskInteractionValue == (int)SpriteMaskInteraction.VisibleOutsideMask);
 						}
 						}
-						#endif
+#endif
 
 
 						EditorGUILayout.Space();
 						EditorGUILayout.Space();
 
 
@@ -421,11 +421,11 @@ namespace Spine.Unity.Editor {
 			}
 			}
 		}
 		}
 
 
-		protected void SkeletonRootMotionParameter() {
+		protected void SkeletonRootMotionParameter () {
 			SkeletonRootMotionParameter(targets);
 			SkeletonRootMotionParameter(targets);
 		}
 		}
 
 
-		public static void SkeletonRootMotionParameter(Object[] targets) {
+		public static void SkeletonRootMotionParameter (Object[] targets) {
 			int rootMotionComponentCount = 0;
 			int rootMotionComponentCount = 0;
 			foreach (var t in targets) {
 			foreach (var t in targets) {
 				var component = t as Component;
 				var component = t as Component;
@@ -454,7 +454,7 @@ namespace Spine.Unity.Editor {
 						foreach (var t in targets) {
 						foreach (var t in targets) {
 							var component = t as Component;
 							var component = t as Component;
 							var rootMotionComponent = component.GetComponent<SkeletonRootMotion>();
 							var rootMotionComponent = component.GetComponent<SkeletonRootMotion>();
-							if (rootMotionComponent  != null) {
+							if (rootMotionComponent != null) {
 								DestroyImmediate(rootMotionComponent);
 								DestroyImmediate(rootMotionComponent);
 							}
 							}
 						}
 						}
@@ -510,7 +510,7 @@ namespace Spine.Unity.Editor {
 			}
 			}
 		}
 		}
 
 
-		public void MaskMaterialsEditingField(ref bool wasSetRequested, ref bool wasDeleteRequested,
+		public void MaskMaterialsEditingField (ref bool wasSetRequested, ref bool wasDeleteRequested,
 													SerializedProperty maskMaterials, GUIContent label,
 													SerializedProperty maskMaterials, GUIContent label,
 													bool differentMaskModesSelected, bool allowDelete, bool isActiveMaterial) {
 													bool differentMaskModesSelected, bool allowDelete, bool isActiveMaterial) {
 			using (new EditorGUILayout.HorizontalScope()) {
 			using (new EditorGUILayout.HorizontalScope()) {
@@ -531,8 +531,7 @@ namespace Spine.Unity.Editor {
 				{
 				{
 					if (GUILayout.Button(ClearMaterialButtonLabel, allowDelete ? EditorStyles.miniButtonMid : EditorStyles.miniButtonRight, GUILayout.Width(46f))) {
 					if (GUILayout.Button(ClearMaterialButtonLabel, allowDelete ? EditorStyles.miniButtonMid : EditorStyles.miniButtonRight, GUILayout.Width(46f))) {
 						maskMaterials.ClearArray();
 						maskMaterials.ClearArray();
-					}
-					else if (allowDelete && GUILayout.Button(DeleteMaterialButtonLabel, EditorStyles.miniButtonRight, GUILayout.Width(46f))) {
+					} else if (allowDelete && GUILayout.Button(DeleteMaterialButtonLabel, EditorStyles.miniButtonRight, GUILayout.Width(46f))) {
 						wasDeleteRequested = true;
 						wasDeleteRequested = true;
 					}
 					}
 					if (!allowDelete)
 					if (!allowDelete)
@@ -542,7 +541,7 @@ namespace Spine.Unity.Editor {
 			}
 			}
 		}
 		}
 
 
-		void HandleSkinChange() {
+		void HandleSkinChange () {
 			if (!Application.isPlaying && Event.current.type == EventType.Layout && !initialSkinName.hasMultipleDifferentValues) {
 			if (!Application.isPlaying && Event.current.type == EventType.Layout && !initialSkinName.hasMultipleDifferentValues) {
 				bool mismatchDetected = false;
 				bool mismatchDetected = false;
 				string newSkinName = initialSkinName.stringValue;
 				string newSkinName = initialSkinName.stringValue;
@@ -574,9 +573,9 @@ namespace Spine.Unity.Editor {
 				// solution or in a separate commit. The current solution does not repaint the Game view because
 				// solution or in a separate commit. The current solution does not repaint the Game view because
 				// it is first applying values and in the next editor pass is calling this skin-changing method.
 				// it is first applying values and in the next editor pass is calling this skin-changing method.
 				if (skeletonRenderer is SkeletonAnimation)
 				if (skeletonRenderer is SkeletonAnimation)
-					((SkeletonAnimation) skeletonRenderer).Update(0f);
+					((SkeletonAnimation)skeletonRenderer).Update(0f);
 				else if (skeletonRenderer is SkeletonMecanim)
 				else if (skeletonRenderer is SkeletonMecanim)
-					((SkeletonMecanim) skeletonRenderer).Update();
+					((SkeletonMecanim)skeletonRenderer).Update();
 
 
 				skeletonRenderer.LateUpdate();
 				skeletonRenderer.LateUpdate();
 				return true;
 				return true;
@@ -584,8 +583,8 @@ namespace Spine.Unity.Editor {
 			return false;
 			return false;
 		}
 		}
 
 
-		bool AreAnyMaskMaterialsMissing() {
-			#if BUILT_IN_SPRITE_MASK_COMPONENT
+		bool AreAnyMaskMaterialsMissing () {
+#if BUILT_IN_SPRITE_MASK_COMPONENT
 			foreach (var o in targets) {
 			foreach (var o in targets) {
 				var component = (SkeletonRenderer)o;
 				var component = (SkeletonRenderer)o;
 				if (!component.valid)
 				if (!component.valid)
@@ -593,11 +592,11 @@ namespace Spine.Unity.Editor {
 				if (SpineMaskUtilities.AreMaskMaterialsMissing(component))
 				if (SpineMaskUtilities.AreMaskMaterialsMissing(component))
 					return true;
 					return true;
 			}
 			}
-			#endif
+#endif
 			return false;
 			return false;
 		}
 		}
 
 
-		#if BUILT_IN_SPRITE_MASK_COMPONENT
+#if BUILT_IN_SPRITE_MASK_COMPONENT
 		static void EditorSetMaskMaterials(SkeletonRenderer component, SpriteMaskInteraction maskType)
 		static void EditorSetMaskMaterials(SkeletonRenderer component, SpriteMaskInteraction maskType)
 		{
 		{
 			if (component == null) return;
 			if (component == null) return;
@@ -610,6 +609,6 @@ namespace Spine.Unity.Editor {
 			if (!SpineEditorUtilities.SkeletonDataAssetIsValid(component.SkeletonDataAsset)) return;
 			if (!SpineEditorUtilities.SkeletonDataAssetIsValid(component.SkeletonDataAsset)) return;
 			SpineMaskUtilities.EditorDeleteMaskMaterials(component.maskMaterials, maskType);
 			SpineMaskUtilities.EditorDeleteMaskMaterials(component.maskMaterials, maskType);
 		}
 		}
-		#endif
+#endif
 	}
 	}
 }
 }

+ 10 - 11
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityBoneInspector.cs

@@ -33,10 +33,10 @@
 #define HINGE_JOINT_NEW_BEHAVIOUR
 #define HINGE_JOINT_NEW_BEHAVIOUR
 #endif
 #endif
 
 
-using UnityEngine;
-using UnityEditor;
-using System.Collections.Generic;
 using Spine;
 using Spine;
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using Icons = SpineEditorUtilities.Icons;
 	using Icons = SpineEditorUtilities.Icons;
@@ -91,7 +91,7 @@ namespace Spine.Unity.Editor {
 			if (skeleton.Skin == null)
 			if (skeleton.Skin == null)
 				skin = skeleton.Data.DefaultSkin;
 				skin = skeleton.Data.DefaultSkin;
 
 
-			for(int i = 0; i < slotCount; i++){
+			for (int i = 0; i < slotCount; i++) {
 				Slot slot = skeletonUtility.Skeleton.Slots.Items[i];
 				Slot slot = skeletonUtility.Skeleton.Slots.Items[i];
 				if (slot.Bone == utilityBone.bone) {
 				if (slot.Bone == utilityBone.bone) {
 					var slotAttachments = new List<Skin.SkinEntry>();
 					var slotAttachments = new List<Skin.SkinEntry>();
@@ -198,7 +198,7 @@ namespace Spine.Unity.Editor {
 			using (new EditorGUI.DisabledGroupScope(multiObject || boundingBoxTable.Count == 0)) {
 			using (new EditorGUI.DisabledGroupScope(multiObject || boundingBoxTable.Count == 0)) {
 				EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Bounding Boxes", Icons.boundingBox), EditorStyles.boldLabel);
 				EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Bounding Boxes", Icons.boundingBox), EditorStyles.boldLabel);
 
 
-				foreach (var entry in boundingBoxTable){
+				foreach (var entry in boundingBoxTable) {
 					Slot slot = entry.Key;
 					Slot slot = entry.Key;
 					var boundingBoxes = entry.Value;
 					var boundingBoxes = entry.Value;
 
 
@@ -367,7 +367,7 @@ namespace Spine.Unity.Editor {
 		}
 		}
 
 
 		void ApplyJoint2DAngleLimits (HingeJoint2D joint, float rotationLimit, Transform parentBone, Transform bone) {
 		void ApplyJoint2DAngleLimits (HingeJoint2D joint, float rotationLimit, Transform parentBone, Transform bone) {
-		#if HINGE_JOINT_NEW_BEHAVIOUR
+#if HINGE_JOINT_NEW_BEHAVIOUR
 			float referenceAngle = (parentBone.eulerAngles.z - bone.eulerAngles.z + 360f) % 360f;
 			float referenceAngle = (parentBone.eulerAngles.z - bone.eulerAngles.z + 360f) % 360f;
 			float minAngle = referenceAngle - rotationLimit;
 			float minAngle = referenceAngle - rotationLimit;
 			float maxAngle = referenceAngle + rotationLimit;
 			float maxAngle = referenceAngle + rotationLimit;
@@ -380,7 +380,7 @@ namespace Spine.Unity.Editor {
 				maxAngle += 360f;
 				maxAngle += 360f;
 			}
 			}
 #else
 #else
-			float minAngle = - rotationLimit;
+			float minAngle = -rotationLimit;
 			float maxAngle = rotationLimit;
 			float maxAngle = rotationLimit;
 #endif
 #endif
 			joint.limits = new JointAngleLimits2D {
 			joint.limits = new JointAngleLimits2D {
@@ -432,7 +432,7 @@ namespace Spine.Unity.Editor {
 			mirroredChain.SetActive(false);
 			mirroredChain.SetActive(false);
 		}
 		}
 
 
-		void FlipBone2DHorizontal(Transform bone, Transform mirrorPosition) {
+		void FlipBone2DHorizontal (Transform bone, Transform mirrorPosition) {
 			Vector3 position = bone.position;
 			Vector3 position = bone.position;
 			position.x = 2 * mirrorPosition.position.x - position.x; // = mirrorPosition + (mirrorPosition - bone.position)
 			position.x = 2 * mirrorPosition.position.x - position.x; // = mirrorPosition + (mirrorPosition - bone.position)
 			bone.position = position;
 			bone.position = position;
@@ -520,14 +520,13 @@ namespace Spine.Unity.Editor {
 			utilBone.gameObject.AddComponent<Rigidbody>();
 			utilBone.gameObject.AddComponent<Rigidbody>();
 		}
 		}
 
 
-		static void AttachRigidbodyAndCollider2D(SkeletonUtilityBone utilBone, bool enableCollider = false) {
+		static void AttachRigidbodyAndCollider2D (SkeletonUtilityBone utilBone, bool enableCollider = false) {
 			if (utilBone.GetComponent<Collider2D>() == null) {
 			if (utilBone.GetComponent<Collider2D>() == null) {
 				if (utilBone.bone.Data.Length == 0) {
 				if (utilBone.bone.Data.Length == 0) {
 					var sphere = utilBone.gameObject.AddComponent<CircleCollider2D>();
 					var sphere = utilBone.gameObject.AddComponent<CircleCollider2D>();
 					sphere.radius = 0.1f;
 					sphere.radius = 0.1f;
 					sphere.enabled = enableCollider;
 					sphere.enabled = enableCollider;
-				}
-				else {
+				} else {
 					float length = utilBone.bone.Data.Length;
 					float length = utilBone.bone.Data.Length;
 					var box = utilBone.gameObject.AddComponent<BoxCollider2D>();
 					var box = utilBone.gameObject.AddComponent<BoxCollider2D>();
 					box.size = new Vector3(length, length / 3f, 0.2f);
 					box.size = new Vector3(length, length / 3f, 0.2f);

+ 10 - 11
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityInspector.cs

@@ -31,12 +31,12 @@
 #define NEW_PREFAB_SYSTEM
 #define NEW_PREFAB_SYSTEM
 #endif
 #endif
 
 
-using UnityEngine;
-using UnityEditor;
-using UnityEditor.AnimatedValues;
-using System.Collections.Generic;
 using Spine;
 using Spine;
+using System.Collections.Generic;
 using System.Reflection;
 using System.Reflection;
+using UnityEditor;
+using UnityEditor.AnimatedValues;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using Icons = SpineEditorUtilities.Icons;
 	using Icons = SpineEditorUtilities.Icons;
@@ -51,7 +51,7 @@ namespace Spine.Unity.Editor {
 
 
 #if !NEW_PREFAB_SYSTEM
 #if !NEW_PREFAB_SYSTEM
 		bool isPrefab;
 		bool isPrefab;
-		#endif
+#endif
 
 
 		readonly GUIContent SpawnHierarchyButtonLabel = new GUIContent("Spawn Hierarchy", Icons.skeleton);
 		readonly GUIContent SpawnHierarchyButtonLabel = new GUIContent("Spawn Hierarchy", Icons.skeleton);
 
 
@@ -65,8 +65,7 @@ namespace Spine.Unity.Editor {
 				if (skeletonRenderer != null) {
 				if (skeletonRenderer != null) {
 					skeletonRenderer.Initialize(false);
 					skeletonRenderer.Initialize(false);
 					skeletonRenderer.LateUpdate();
 					skeletonRenderer.LateUpdate();
-				}
-				else if (skeletonGraphic != null) {
+				} else if (skeletonGraphic != null) {
 					skeletonGraphic.Initialize(false);
 					skeletonGraphic.Initialize(false);
 					skeletonGraphic.LateUpdate();
 					skeletonGraphic.LateUpdate();
 				}
 				}
@@ -76,19 +75,19 @@ namespace Spine.Unity.Editor {
 			if ((skeletonRenderer != null && !skeletonRenderer.valid) ||
 			if ((skeletonRenderer != null && !skeletonRenderer.valid) ||
 				(skeletonGraphic != null && !skeletonGraphic.IsValid)) return;
 				(skeletonGraphic != null && !skeletonGraphic.IsValid)) return;
 
 
-			#if !NEW_PREFAB_SYSTEM
+#if !NEW_PREFAB_SYSTEM
 			isPrefab |= PrefabUtility.GetPrefabType(this.target) == PrefabType.Prefab;
 			isPrefab |= PrefabUtility.GetPrefabType(this.target) == PrefabType.Prefab;
-			#endif
+#endif
 		}
 		}
 
 
 		public override void OnInspectorGUI () {
 		public override void OnInspectorGUI () {
 
 
-			#if !NEW_PREFAB_SYSTEM
+#if !NEW_PREFAB_SYSTEM
 			if (isPrefab) {
 			if (isPrefab) {
 				GUILayout.Label(new GUIContent("Cannot edit Prefabs", Icons.warning));
 				GUILayout.Label(new GUIContent("Cannot edit Prefabs", Icons.warning));
 				return;
 				return;
 			}
 			}
-			#endif
+#endif
 
 
 			serializedObject.Update();
 			serializedObject.Update();
 
 

+ 7 - 12
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs

@@ -27,10 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using UnityEditor;
 using Spine.Unity;
 using Spine.Unity;
-
+using UnityEditor;
+using UnityEngine;
 using SpineInspectorUtility = Spine.Unity.Editor.SpineInspectorUtility;
 using SpineInspectorUtility = Spine.Unity.Editor.SpineInspectorUtility;
 
 
 public class SpineShaderWithOutlineGUI : ShaderGUI {
 public class SpineShaderWithOutlineGUI : ShaderGUI {
@@ -97,7 +96,7 @@ public class SpineShaderWithOutlineGUI : ShaderGUI {
 		_StencilComp = FindProperty("_StencilComp", props, false);
 		_StencilComp = FindProperty("_StencilComp", props, false);
 		_StencilRef = FindProperty("_StencilRef", props, false);
 		_StencilRef = FindProperty("_StencilRef", props, false);
 		if (_StencilRef == null)
 		if (_StencilRef == null)
-			 _StencilRef = FindProperty("_Stencil", props, false);
+			_StencilRef = FindProperty("_Stencil", props, false);
 	}
 	}
 
 
 	protected virtual void RenderStencilProperties () {
 	protected virtual void RenderStencilProperties () {
@@ -141,8 +140,7 @@ public class SpineShaderWithOutlineGUI : ShaderGUI {
 					SwitchShaderToOutlineSettings(material, isOutlineEnabled);
 					SwitchShaderToOutlineSettings(material, isOutlineEnabled);
 				}
 				}
 			}
 			}
-		}
-		else {
+		} else {
 			var origFontStyle = EditorStyles.label.fontStyle;
 			var origFontStyle = EditorStyles.label.fontStyle;
 			EditorStyles.label.fontStyle = FontStyle.Bold;
 			EditorStyles.label.fontStyle = FontStyle.Bold;
 			EditorGUILayout.LabelField(_EnableOutlineText);
 			EditorGUILayout.LabelField(_EnableOutlineText);
@@ -178,8 +176,7 @@ public class SpineShaderWithOutlineGUI : ShaderGUI {
 			shaderName = shaderName.Replace(ShaderOutlineNamePrefix, ShaderNormalNamePrefix);
 			shaderName = shaderName.Replace(ShaderOutlineNamePrefix, ShaderNormalNamePrefix);
 			_materialEditor.SetShader(Shader.Find(shaderName), false);
 			_materialEditor.SetShader(Shader.Find(shaderName), false);
 			return;
 			return;
-		}
-		else if (!isSetToOutlineShader && enableOutline) {
+		} else if (!isSetToOutlineShader && enableOutline) {
 			shaderName = shaderName.Replace(ShaderNormalNamePrefix, ShaderOutlineNamePrefix);
 			shaderName = shaderName.Replace(ShaderNormalNamePrefix, ShaderOutlineNamePrefix);
 			_materialEditor.SetShader(Shader.Find(shaderName), false);
 			_materialEditor.SetShader(Shader.Find(shaderName), false);
 			return;
 			return;
@@ -192,8 +189,7 @@ public class SpineShaderWithOutlineGUI : ShaderGUI {
 		foreach (Material material in editor.targets) {
 		foreach (Material material in editor.targets) {
 			if (material.shader.name.Contains(ShaderOutlineNamePrefix)) {
 			if (material.shader.name.Contains(ShaderOutlineNamePrefix)) {
 				isAnyEnabled = true;
 				isAnyEnabled = true;
-			}
-			else if (isAnyEnabled) {
+			} else if (isAnyEnabled) {
 				mixedValue = true;
 				mixedValue = true;
 			}
 			}
 		}
 		}
@@ -206,8 +202,7 @@ public class SpineShaderWithOutlineGUI : ShaderGUI {
 		foreach (Material material in editor.targets) {
 		foreach (Material material in editor.targets) {
 			if (material.shader.name.Contains(ShaderWithoutStandardVariantSuffix)) {
 			if (material.shader.name.Contains(ShaderWithoutStandardVariantSuffix)) {
 				isAnyShaderWithoutVariant = true;
 				isAnyShaderWithoutVariant = true;
-			}
-			else if (isAnyShaderWithoutVariant) {
+			} else if (isAnyShaderWithoutVariant) {
 				mixedValue = true;
 				mixedValue = true;
 			}
 			}
 		}
 		}

+ 72 - 89
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineSpriteShaderGUI.cs

@@ -27,10 +27,9 @@
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
  *****************************************************************************/
 
 
-using UnityEngine;
-using UnityEditor;
 using Spine.Unity;
 using Spine.Unity;
-
+using UnityEditor;
+using UnityEngine;
 using SpineInspectorUtility = Spine.Unity.Editor.SpineInspectorUtility;
 using SpineInspectorUtility = Spine.Unity.Editor.SpineInspectorUtility;
 
 
 public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
 public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
@@ -528,17 +527,15 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
 					eBlendMode blendMode = GetMaterialBlendMode(material);
 					eBlendMode blendMode = GetMaterialBlendMode(material);
 
 
 					switch (blendMode) {
 					switch (blendMode) {
-					case eBlendMode.Opaque:
-						{
-							SetRenderType(material, "Opaque", useCustomRenderType);
-						}
-						break;
-					default:
-						{
-							bool zWrite = HasZWriteEnabled(material);
-							SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderType);
-						}
-						break;
+					case eBlendMode.Opaque: {
+						SetRenderType(material, "Opaque", useCustomRenderType);
+					}
+					break;
+					default: {
+						bool zWrite = HasZWriteEnabled(material);
+						SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderType);
+					}
+					break;
 					}
 					}
 				}
 				}
 			}
 			}
@@ -942,14 +939,13 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
 			case eNormalsMode.FixedNormalsModelSpace:
 			case eNormalsMode.FixedNormalsModelSpace:
 				renderType = "SpriteModelSpaceFixedNormal";
 				renderType = "SpriteModelSpaceFixedNormal";
 				break;
 				break;
-			case eNormalsMode.MeshNormals:
-				{
-					//If sprite doesn't write to depth assign custom render type so we can write its depth with soft edges
-					if (!zWrite) {
-						renderType = "Sprite";
-					}
+			case eNormalsMode.MeshNormals: {
+				//If sprite doesn't write to depth assign custom render type so we can write its depth with soft edges
+				if (!zWrite) {
+					renderType = "Sprite";
 				}
 				}
-				break;
+			}
+			break;
 			}
 			}
 		}
 		}
 
 
@@ -1014,8 +1010,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
 		foreach (Material material in editor.targets) {
 		foreach (Material material in editor.targets) {
 			if (material.shader.name == shaderType) {
 			if (material.shader.name == shaderType) {
 				isAnyTargetTypeShader = true;
 				isAnyTargetTypeShader = true;
-			}
-			else if (isAnyTargetTypeShader) {
+			} else if (isAnyTargetTypeShader) {
 				mixedValue = true;
 				mixedValue = true;
 			}
 			}
 		}
 		}
@@ -1040,21 +1035,16 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
 		if (material.shader.name == kShaderPixelLit ||
 		if (material.shader.name == kShaderPixelLit ||
 			material.shader.name == kShaderPixelLitOutline) {
 			material.shader.name == kShaderPixelLitOutline) {
 			return eLightMode.PixelLit;
 			return eLightMode.PixelLit;
-		}
-		else if (material.shader.name == kShaderUnlit ||
-				material.shader.name == kShaderUnlitOutline) {
+		} else if (material.shader.name == kShaderUnlit ||
+				  material.shader.name == kShaderUnlitOutline) {
 			return eLightMode.Unlit;
 			return eLightMode.Unlit;
-		}
-		else if (material.shader.name == kShaderLitLW) {
+		} else if (material.shader.name == kShaderLitLW) {
 			return eLightMode.LitLightweight;
 			return eLightMode.LitLightweight;
-		}
-		else if (material.shader.name == kShaderLitURP) {
+		} else if (material.shader.name == kShaderLitURP) {
 			return eLightMode.LitUniversal;
 			return eLightMode.LitUniversal;
-		}
-		else if (material.shader.name == kShaderLitURP2D) {
+		} else if (material.shader.name == kShaderLitURP2D) {
 			return eLightMode.LitUniversal2D;
 			return eLightMode.LitUniversal2D;
-		}
-		else { // if (material.shader.name == kShaderVertexLit || kShaderVertexLitOutline)
+		} else { // if (material.shader.name == kShaderVertexLit || kShaderVertexLitOutline)
 			return eLightMode.VertexLit;
 			return eLightMode.VertexLit;
 		}
 		}
 	}
 	}
@@ -1091,59 +1081,53 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
 		bool useCustomRenderQueue = material.GetFloat("_CustomRenderQueue") > 0.0f;
 		bool useCustomRenderQueue = material.GetFloat("_CustomRenderQueue") > 0.0f;
 
 
 		switch (blendMode) {
 		switch (blendMode) {
-		case eBlendMode.Opaque:
-			{
-				material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
-				material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
-				SetRenderType(material, "Opaque", useCustomRenderQueue);
-				renderQueue = kSolidQueue;
-			}
-			break;
-		case eBlendMode.Additive:
-			{
-				material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
-				material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.One);
-				bool zWrite = HasZWriteEnabled(material);
-				SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue);
-				renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue;
-			}
-			break;
-		case eBlendMode.SoftAdditive:
-			{
-				material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
-				material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcColor);
-				bool zWrite = HasZWriteEnabled(material);
-				SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue);
-				renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue;
-			}
-			break;
-		case eBlendMode.Multiply:
-			{
-				material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
-				material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.SrcColor);
-				bool zWrite = HasZWriteEnabled(material);
-				SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue);
-				renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue;
-			}
-			break;
-		case eBlendMode.Multiplyx2:
-			{
-				material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.DstColor);
-				material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.SrcColor);
-				bool zWrite = HasZWriteEnabled(material);
-				SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue);
-				renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue;
-			}
-			break;
-		default:
-			{
-				material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
-				material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
-				bool zWrite = HasZWriteEnabled(material);
-				SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue);
-				renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue;
-			}
-			break;
+		case eBlendMode.Opaque: {
+			material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
+			material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
+			SetRenderType(material, "Opaque", useCustomRenderQueue);
+			renderQueue = kSolidQueue;
+		}
+		break;
+		case eBlendMode.Additive: {
+			material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
+			material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.One);
+			bool zWrite = HasZWriteEnabled(material);
+			SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue);
+			renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue;
+		}
+		break;
+		case eBlendMode.SoftAdditive: {
+			material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
+			material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcColor);
+			bool zWrite = HasZWriteEnabled(material);
+			SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue);
+			renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue;
+		}
+		break;
+		case eBlendMode.Multiply: {
+			material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
+			material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.SrcColor);
+			bool zWrite = HasZWriteEnabled(material);
+			SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue);
+			renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue;
+		}
+		break;
+		case eBlendMode.Multiplyx2: {
+			material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.DstColor);
+			material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.SrcColor);
+			bool zWrite = HasZWriteEnabled(material);
+			SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue);
+			renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue;
+		}
+		break;
+		default: {
+			material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
+			material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
+			bool zWrite = HasZWriteEnabled(material);
+			SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue);
+			renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue;
+		}
+		break;
 		}
 		}
 
 
 		material.renderQueue = renderQueue + material.GetInt("_RenderQueue");
 		material.renderQueue = renderQueue + material.GetInt("_RenderQueue");
@@ -1209,8 +1193,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
 	static bool HasZWriteEnabled (Material material) {
 	static bool HasZWriteEnabled (Material material) {
 		if (material.HasProperty("_ZWrite")) {
 		if (material.HasProperty("_ZWrite")) {
 			return material.GetFloat("_ZWrite") > 0.0f;
 			return material.GetFloat("_ZWrite") > 0.0f;
-		}
-		else return true; // Pixel Lit shader always has _ZWrite enabled.
+		} else return true; // Pixel Lit shader always has _ZWrite enabled.
 	}
 	}
 	#endregion
 	#endregion
 }
 }

+ 14 - 14
spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineAttributeDrawers.cs

@@ -29,13 +29,13 @@
 
 
 // Contributed by: Mitch Thompson
 // Contributed by: Mitch Thompson
 
 
-using UnityEngine;
-using UnityEditor;
+using Spine;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Reflection;
-using Spine;
 using System.Linq;
 using System.Linq;
+using System.Reflection;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	public struct SpineDrawerValuePair {
 	public struct SpineDrawerValuePair {
@@ -48,7 +48,7 @@ namespace Spine.Unity.Editor {
 		}
 		}
 	}
 	}
 
 
-	public abstract class SpineTreeItemDrawerBase<T> : PropertyDrawer where T:SpineAttributeBase {
+	public abstract class SpineTreeItemDrawerBase<T> : PropertyDrawer where T : SpineAttributeBase {
 		protected SkeletonDataAsset skeletonDataAsset;
 		protected SkeletonDataAsset skeletonDataAsset;
 		internal const string NoneStringConstant = "<None>";
 		internal const string NoneStringConstant = "<None>";
 
 
@@ -172,7 +172,7 @@ namespace Spine.Unity.Editor {
 	[CustomPropertyDrawer(typeof(SpineSlot))]
 	[CustomPropertyDrawer(typeof(SpineSlot))]
 	public class SpineSlotDrawer : SpineTreeItemDrawerBase<SpineSlot> {
 	public class SpineSlotDrawer : SpineTreeItemDrawerBase<SpineSlot> {
 
 
-		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.slot; } }
+		protected override Texture2D Icon { get { return SpineEditorUtilities.Icons.slot; } }
 
 
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineSlot targetAttribute, SkeletonData data) {
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineSlot targetAttribute, SkeletonData data) {
 			if (TargetAttribute.includeNone)
 			if (TargetAttribute.includeNone)
@@ -219,7 +219,7 @@ namespace Spine.Unity.Editor {
 	public class SpineSkinDrawer : SpineTreeItemDrawerBase<SpineSkin> {
 	public class SpineSkinDrawer : SpineTreeItemDrawerBase<SpineSkin> {
 		const string DefaultSkinName = "default";
 		const string DefaultSkinName = "default";
 
 
-		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.skin; } }
+		protected override Texture2D Icon { get { return SpineEditorUtilities.Icons.skin; } }
 
 
 		internal override string NoneString { get { return TargetAttribute.defaultAsEmptyString ? DefaultSkinName : NoneStringConstant; } }
 		internal override string NoneString { get { return TargetAttribute.defaultAsEmptyString ? DefaultSkinName : NoneStringConstant; } }
 
 
@@ -267,7 +267,7 @@ namespace Spine.Unity.Editor {
 	[CustomPropertyDrawer(typeof(SpineAnimation))]
 	[CustomPropertyDrawer(typeof(SpineAnimation))]
 	public class SpineAnimationDrawer : SpineTreeItemDrawerBase<SpineAnimation> {
 	public class SpineAnimationDrawer : SpineTreeItemDrawerBase<SpineAnimation> {
 
 
-		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.animation; } }
+		protected override Texture2D Icon { get { return SpineEditorUtilities.Icons.animation; } }
 
 
 		public static void GetAnimationMenuItems (SkeletonData data, List<string> outputNames, List<GUIContent> outputMenuItems, bool includeNone = true) {
 		public static void GetAnimationMenuItems (SkeletonData data, List<string> outputNames, List<GUIContent> outputMenuItems, bool includeNone = true) {
 			if (data == null) return;
 			if (data == null) return;
@@ -309,7 +309,7 @@ namespace Spine.Unity.Editor {
 	[CustomPropertyDrawer(typeof(SpineEvent))]
 	[CustomPropertyDrawer(typeof(SpineEvent))]
 	public class SpineEventNameDrawer : SpineTreeItemDrawerBase<SpineEvent> {
 	public class SpineEventNameDrawer : SpineTreeItemDrawerBase<SpineEvent> {
 
 
-		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.userEvent; } }
+		protected override Texture2D Icon { get { return SpineEditorUtilities.Icons.userEvent; } }
 
 
 		public static void GetEventMenuItems (SkeletonData data, List<string> eventNames, List<GUIContent> menuItems, bool includeNone = true) {
 		public static void GetEventMenuItems (SkeletonData data, List<string> eventNames, List<GUIContent> menuItems, bool includeNone = true) {
 			if (data == null) return;
 			if (data == null) return;
@@ -354,7 +354,7 @@ namespace Spine.Unity.Editor {
 	[CustomPropertyDrawer(typeof(SpineIkConstraint))]
 	[CustomPropertyDrawer(typeof(SpineIkConstraint))]
 	public class SpineIkConstraintDrawer : SpineTreeItemDrawerBase<SpineIkConstraint> {
 	public class SpineIkConstraintDrawer : SpineTreeItemDrawerBase<SpineIkConstraint> {
 
 
-		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.constraintIK; } }
+		protected override Texture2D Icon { get { return SpineEditorUtilities.Icons.constraintIK; } }
 
 
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineIkConstraint targetAttribute, SkeletonData data) {
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineIkConstraint targetAttribute, SkeletonData data) {
 			var constraints = skeletonDataAsset.GetSkeletonData(false).IkConstraints;
 			var constraints = skeletonDataAsset.GetSkeletonData(false).IkConstraints;
@@ -374,7 +374,7 @@ namespace Spine.Unity.Editor {
 	[CustomPropertyDrawer(typeof(SpineTransformConstraint))]
 	[CustomPropertyDrawer(typeof(SpineTransformConstraint))]
 	public class SpineTransformConstraintDrawer : SpineTreeItemDrawerBase<SpineTransformConstraint> {
 	public class SpineTransformConstraintDrawer : SpineTreeItemDrawerBase<SpineTransformConstraint> {
 
 
-		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.constraintTransform; } }
+		protected override Texture2D Icon { get { return SpineEditorUtilities.Icons.constraintTransform; } }
 
 
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineTransformConstraint targetAttribute, SkeletonData data) {
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineTransformConstraint targetAttribute, SkeletonData data) {
 			var constraints = skeletonDataAsset.GetSkeletonData(false).TransformConstraints;
 			var constraints = skeletonDataAsset.GetSkeletonData(false).TransformConstraints;
@@ -393,7 +393,7 @@ namespace Spine.Unity.Editor {
 	[CustomPropertyDrawer(typeof(SpinePathConstraint))]
 	[CustomPropertyDrawer(typeof(SpinePathConstraint))]
 	public class SpinePathConstraintDrawer : SpineTreeItemDrawerBase<SpinePathConstraint> {
 	public class SpinePathConstraintDrawer : SpineTreeItemDrawerBase<SpinePathConstraint> {
 
 
-		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.constraintPath; } }
+		protected override Texture2D Icon { get { return SpineEditorUtilities.Icons.constraintPath; } }
 
 
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpinePathConstraint targetAttribute, SkeletonData data) {
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpinePathConstraint targetAttribute, SkeletonData data) {
 			var constraints = skeletonDataAsset.GetSkeletonData(false).PathConstraints;
 			var constraints = skeletonDataAsset.GetSkeletonData(false).PathConstraints;
@@ -412,7 +412,7 @@ namespace Spine.Unity.Editor {
 	[CustomPropertyDrawer(typeof(SpineAttachment))]
 	[CustomPropertyDrawer(typeof(SpineAttachment))]
 	public class SpineAttachmentDrawer : SpineTreeItemDrawerBase<SpineAttachment> {
 	public class SpineAttachmentDrawer : SpineTreeItemDrawerBase<SpineAttachment> {
 
 
-		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.genericAttachment; } }
+		protected override Texture2D Icon { get { return SpineEditorUtilities.Icons.genericAttachment; } }
 
 
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineAttachment targetAttribute, SkeletonData data) {
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineAttachment targetAttribute, SkeletonData data) {
 			ISkeletonComponent skeletonComponent = GetTargetSkeletonComponent(property);
 			ISkeletonComponent skeletonComponent = GetTargetSkeletonComponent(property);
@@ -514,7 +514,7 @@ namespace Spine.Unity.Editor {
 	[CustomPropertyDrawer(typeof(SpineBone))]
 	[CustomPropertyDrawer(typeof(SpineBone))]
 	public class SpineBoneDrawer : SpineTreeItemDrawerBase<SpineBone> {
 	public class SpineBoneDrawer : SpineTreeItemDrawerBase<SpineBone> {
 
 
-		protected override Texture2D Icon {	get { return SpineEditorUtilities.Icons.bone; } }
+		protected override Texture2D Icon { get { return SpineEditorUtilities.Icons.bone; } }
 
 
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineBone targetAttribute, SkeletonData data) {
 		protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineBone targetAttribute, SkeletonData data) {
 			menu.AddDisabledItem(new GUIContent(skeletonDataAsset.name));
 			menu.AddDisabledItem(new GUIContent(skeletonDataAsset.name));

+ 108 - 115
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs

@@ -51,14 +51,13 @@
 #define PROBLEMATIC_PACKAGE_ASSET_MODIFICATION
 #define PROBLEMATIC_PACKAGE_ASSET_MODIFICATION
 #endif
 #endif
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
-using System.Text;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-
+using System.Text;
+using UnityEditor;
+using UnityEngine;
 using CompatibilityProblemInfo = Spine.Unity.SkeletonDataCompatibility.CompatibilityProblemInfo;
 using CompatibilityProblemInfo = Spine.Unity.SkeletonDataCompatibility.CompatibilityProblemInfo;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
@@ -115,7 +114,7 @@ namespace Spine.Unity.Editor {
 			}
 			}
 		}
 		}
 
 
-#region Match SkeletonData with Atlases
+		#region Match SkeletonData with Atlases
 		static readonly AttachmentType[] AtlasTypes = { AttachmentType.Region, AttachmentType.Linkedmesh, AttachmentType.Mesh };
 		static readonly AttachmentType[] AtlasTypes = { AttachmentType.Region, AttachmentType.Linkedmesh, AttachmentType.Mesh };
 
 
 		public static List<string> GetRequiredAtlasRegions (string skeletonDataPath) {
 		public static List<string> GetRequiredAtlasRegions (string skeletonDataPath) {
@@ -132,15 +131,13 @@ namespace Spine.Unity.Editor {
 			try {
 			try {
 				if (spineJson != null) {
 				if (spineJson != null) {
 					reader = new StringReader(spineJson.text);
 					reader = new StringReader(spineJson.text);
-				}
-				else {
+				} else {
 					// On a "Reimport All" the order of imports can be wrong, thus LoadAssetAtPath() above could return null.
 					// On a "Reimport All" the order of imports can be wrong, thus LoadAssetAtPath() above could return null.
 					// as a workaround, we provide a fallback reader.
 					// as a workaround, we provide a fallback reader.
 					reader = new StreamReader(skeletonDataPath);
 					reader = new StreamReader(skeletonDataPath);
 				}
 				}
 				root = Json.Deserialize(reader) as Dictionary<string, object>;
 				root = Json.Deserialize(reader) as Dictionary<string, object>;
-			}
-			finally {
+			} finally {
 				if (reader != null)
 				if (reader != null)
 					reader.Dispose();
 					reader.Dispose();
 			}
 			}
@@ -195,15 +192,13 @@ namespace Spine.Unity.Editor {
 			try {
 			try {
 				if (data != null) {
 				if (data != null) {
 					input = new MemoryStream(data.bytes);
 					input = new MemoryStream(data.bytes);
-				}
-				else {
+				} else {
 					// On a "Reimport All" the order of imports can be wrong, thus LoadAssetAtPath() above could return null.
 					// On a "Reimport All" the order of imports can be wrong, thus LoadAssetAtPath() above could return null.
 					// as a workaround, we provide a fallback reader.
 					// as a workaround, we provide a fallback reader.
 					input = File.Open(skeletonDataPath, FileMode.Open, FileAccess.Read);
 					input = File.Open(skeletonDataPath, FileMode.Open, FileAccess.Read);
 				}
 				}
 				binary.ReadSkeletonData(input);
 				binary.ReadSkeletonData(input);
-			}
-			finally {
+			} finally {
 				if (input != null)
 				if (input != null)
 					input.Dispose();
 					input.Dispose();
 			}
 			}
@@ -265,7 +260,7 @@ namespace Spine.Unity.Editor {
 				return new ClippingAttachment(name);
 				return new ClippingAttachment(name);
 			}
 			}
 		}
 		}
-#endregion
+		#endregion
 
 
 		public static void ImportSpineContent (string[] imported, List<string> texturesWithoutMetaFile,
 		public static void ImportSpineContent (string[] imported, List<string> texturesWithoutMetaFile,
 			bool reimport = false) {
 			bool reimport = false) {
@@ -278,49 +273,49 @@ namespace Spine.Unity.Editor {
 			foreach (string str in imported) {
 			foreach (string str in imported) {
 				string extension = Path.GetExtension(str).ToLower();
 				string extension = Path.GetExtension(str).ToLower();
 				switch (extension) {
 				switch (extension) {
-					case ".atlas":
-						if (SpineEditorUtilities.Preferences.atlasTxtImportWarning) {
-							Debug.LogWarningFormat("`{0}` : If this file is a Spine atlas, please change its extension to `.atlas.txt`. This is to allow Unity to recognize it and avoid filename collisions. You can also set this file extension when exporting from the Spine editor.", str);
-						}
-						break;
-					case ".txt":
-						if (str.EndsWith(".atlas.txt", System.StringComparison.Ordinal))
-							atlasPaths.Add(str);
-						break;
-					case ".png":
-					case ".jpg":
-						imagePaths.Add(str);
-						break;
-					case ".json": {
-						var jsonAsset = AssetDatabase.LoadAssetAtPath<TextAsset>(str);
+				case ".atlas":
+					if (SpineEditorUtilities.Preferences.atlasTxtImportWarning) {
+						Debug.LogWarningFormat("`{0}` : If this file is a Spine atlas, please change its extension to `.atlas.txt`. This is to allow Unity to recognize it and avoid filename collisions. You can also set this file extension when exporting from the Spine editor.", str);
+					}
+					break;
+				case ".txt":
+					if (str.EndsWith(".atlas.txt", System.StringComparison.Ordinal))
+						atlasPaths.Add(str);
+					break;
+				case ".png":
+				case ".jpg":
+					imagePaths.Add(str);
+					break;
+				case ".json": {
+					var jsonAsset = AssetDatabase.LoadAssetAtPath<TextAsset>(str);
+					string problemDescription = null;
+					if (jsonAsset != null && IsSpineData(jsonAsset, out compatibilityProblemInfo, ref problemDescription))
+						skeletonPaths.Add(new PathAndProblemInfo(str, compatibilityProblemInfo, problemDescription));
+					if (problemDescription != null)
+						Debug.LogError(problemDescription, jsonAsset);
+					break;
+				}
+				case ".bytes": {
+					if (str.ToLower().EndsWith(".skel.bytes", System.StringComparison.Ordinal)) {
+						var binaryAsset = AssetDatabase.LoadAssetAtPath<TextAsset>(str);
 						string problemDescription = null;
 						string problemDescription = null;
-						if (jsonAsset != null && IsSpineData(jsonAsset, out compatibilityProblemInfo, ref problemDescription))
+						if (IsSpineData(binaryAsset, out compatibilityProblemInfo, ref problemDescription))
 							skeletonPaths.Add(new PathAndProblemInfo(str, compatibilityProblemInfo, problemDescription));
 							skeletonPaths.Add(new PathAndProblemInfo(str, compatibilityProblemInfo, problemDescription));
 						if (problemDescription != null)
 						if (problemDescription != null)
-							Debug.LogError(problemDescription, jsonAsset);
-						break;
-					}
-					case ".bytes": {
-						if (str.ToLower().EndsWith(".skel.bytes", System.StringComparison.Ordinal)) {
-							var binaryAsset = AssetDatabase.LoadAssetAtPath<TextAsset>(str);
-							string problemDescription = null;
-							if (IsSpineData(binaryAsset, out compatibilityProblemInfo, ref problemDescription))
-								skeletonPaths.Add(new PathAndProblemInfo(str, compatibilityProblemInfo, problemDescription));
-							if (problemDescription != null)
-								Debug.LogError(problemDescription, binaryAsset);
-						}
-						break;
+							Debug.LogError(problemDescription, binaryAsset);
 					}
 					}
+					break;
+				}
 				}
 				}
 			}
 			}
 
 
 			// Import atlases first.
 			// Import atlases first.
 			var newAtlases = new List<AtlasAssetBase>();
 			var newAtlases = new List<AtlasAssetBase>();
 			foreach (string ap in atlasPaths) {
 			foreach (string ap in atlasPaths) {
-			#if PROBLEMATIC_PACKAGE_ASSET_MODIFICATION
+#if PROBLEMATIC_PACKAGE_ASSET_MODIFICATION
 				if (ap.StartsWith("Packages"))
 				if (ap.StartsWith("Packages"))
 					continue;
 					continue;
-			#endif
+#endif
 				TextAsset atlasText = AssetDatabase.LoadAssetAtPath<TextAsset>(ap);
 				TextAsset atlasText = AssetDatabase.LoadAssetAtPath<TextAsset>(ap);
 				AtlasAssetBase atlas = IngestSpineAtlas(atlasText, texturesWithoutMetaFile);
 				AtlasAssetBase atlas = IngestSpineAtlas(atlasText, texturesWithoutMetaFile);
 				newAtlases.Add(atlas);
 				newAtlases.Add(atlas);
@@ -333,10 +328,10 @@ namespace Spine.Unity.Editor {
 				string skeletonPath = skeletonPathEntry.path;
 				string skeletonPath = skeletonPathEntry.path;
 				var compatibilityProblems = skeletonPathEntry.compatibilityProblems;
 				var compatibilityProblems = skeletonPathEntry.compatibilityProblems;
 				string otherProblemDescription = skeletonPathEntry.otherProblemDescription;
 				string otherProblemDescription = skeletonPathEntry.otherProblemDescription;
-			#if PROBLEMATIC_PACKAGE_ASSET_MODIFICATION
+#if PROBLEMATIC_PACKAGE_ASSET_MODIFICATION
 				if (skeletonPath.StartsWith("Packages"))
 				if (skeletonPath.StartsWith("Packages"))
 					continue;
 					continue;
-			#endif
+#endif
 				if (!reimport && CheckForValidSkeletonData(skeletonPath)) {
 				if (!reimport && CheckForValidSkeletonData(skeletonPath)) {
 					ReloadSkeletonData(skeletonPath, compatibilityProblems);
 					ReloadSkeletonData(skeletonPath, compatibilityProblems);
 					continue;
 					continue;
@@ -401,16 +396,16 @@ namespace Spine.Unity.Editor {
 			}
 			}
 		}
 		}
 
 
-		static void AddDependentSkeletonIfAtlasChanged(List<PathAndProblemInfo> skeletonPaths, List<string> atlasPaths) {
+		static void AddDependentSkeletonIfAtlasChanged (List<PathAndProblemInfo> skeletonPaths, List<string> atlasPaths) {
 			foreach (var atlasPath in atlasPaths) {
 			foreach (var atlasPath in atlasPaths) {
 				string skeletonPathJson = atlasPath.Replace(".atlas.txt", ".json");
 				string skeletonPathJson = atlasPath.Replace(".atlas.txt", ".json");
-				string skeletonPathBinary =  atlasPath.Replace(".atlas.txt", ".skel.bytes");
+				string skeletonPathBinary = atlasPath.Replace(".atlas.txt", ".skel.bytes");
 				string usedSkeletonPath = System.IO.File.Exists(skeletonPathJson) ? skeletonPathJson :
 				string usedSkeletonPath = System.IO.File.Exists(skeletonPathJson) ? skeletonPathJson :
 										System.IO.File.Exists(skeletonPathBinary) ? skeletonPathBinary : null;
 										System.IO.File.Exists(skeletonPathBinary) ? skeletonPathBinary : null;
 				if (usedSkeletonPath == null)
 				if (usedSkeletonPath == null)
 					continue;
 					continue;
 
 
-				if (skeletonPaths.FindIndex(p => { return p.path == usedSkeletonPath; } ) < 0) {
+				if (skeletonPaths.FindIndex(p => { return p.path == usedSkeletonPath; }) < 0) {
 					string problemDescription = null;
 					string problemDescription = null;
 					CompatibilityProblemInfo compatibilityProblemInfo = null;
 					CompatibilityProblemInfo compatibilityProblemInfo = null;
 					TextAsset textAsset = AssetDatabase.LoadAssetAtPath<TextAsset>(usedSkeletonPath);
 					TextAsset textAsset = AssetDatabase.LoadAssetAtPath<TextAsset>(usedSkeletonPath);
@@ -485,7 +480,7 @@ namespace Spine.Unity.Editor {
 			}
 			}
 		}
 		}
 
 
-#region Import Atlases
+		#region Import Atlases
 		static List<AtlasAssetBase> FindAtlasesAtPath (string path) {
 		static List<AtlasAssetBase> FindAtlasesAtPath (string path) {
 			List<AtlasAssetBase> arr = new List<AtlasAssetBase>();
 			List<AtlasAssetBase> arr = new List<AtlasAssetBase>();
 			DirectoryInfo dir = new DirectoryInfo(path);
 			DirectoryInfo dir = new DirectoryInfo(path);
@@ -528,7 +523,7 @@ namespace Spine.Unity.Editor {
 			atlasAsset.atlasFile = atlasText;
 			atlasAsset.atlasFile = atlasText;
 
 
 			List<string> pageFiles = new List<string>();
 			List<string> pageFiles = new List<string>();
-			Atlas atlas = atlasAsset.GetAtlas(onlyMetaData : true);
+			Atlas atlas = atlasAsset.GetAtlas(onlyMetaData: true);
 			if (atlas != null) {
 			if (atlas != null) {
 				foreach (var page in atlas.Pages)
 				foreach (var page in atlas.Pages)
 					pageFiles.Add(page.name);
 					pageFiles.Add(page.name);
@@ -679,8 +674,7 @@ namespace Spine.Unity.Editor {
 			byte[] bytes = null;
 			byte[] bytes = null;
 			try {
 			try {
 				bytes = tempTexture.EncodeToPNG();
 				bytes = tempTexture.EncodeToPNG();
-			}
-			catch (System.Exception) {
+			} catch (System.Exception) {
 				// handled below
 				// handled below
 			}
 			}
 			if (bytes == null || bytes.Length == 0) {
 			if (bytes == null || bytes.Length == 0) {
@@ -747,8 +741,7 @@ namespace Spine.Unity.Editor {
 					mat = new Material(Shader.Find(SpineEditorUtilities.Preferences.defaultShader));
 					mat = new Material(Shader.Find(SpineEditorUtilities.Preferences.defaultShader));
 					ApplyPMAOrStraightAlphaSettings(mat, SpineEditorUtilities.Preferences.textureSettingsReference);
 					ApplyPMAOrStraightAlphaSettings(mat, SpineEditorUtilities.Preferences.textureSettingsReference);
 					AssetDatabase.CreateAsset(mat, materialPath);
 					AssetDatabase.CreateAsset(mat, materialPath);
-				}
-				else {
+				} else {
 					vestigialMaterials.Remove(mat);
 					vestigialMaterials.Remove(mat);
 				}
 				}
 
 
@@ -857,16 +850,16 @@ namespace Spine.Unity.Editor {
 
 
 			MaterialChecks.EnablePMATextureAtMaterial(material, isUsingPMAWorkflow);
 			MaterialChecks.EnablePMATextureAtMaterial(material, isUsingPMAWorkflow);
 		}
 		}
-#endregion
+		#endregion
 
 
-#region Import SkeletonData (json or binary)
-		internal static string GetSkeletonDataAssetFilePath(TextAsset spineJson) {
+		#region Import SkeletonData (json or binary)
+		internal static string GetSkeletonDataAssetFilePath (TextAsset spineJson) {
 			string primaryName = Path.GetFileNameWithoutExtension(spineJson.name);
 			string primaryName = Path.GetFileNameWithoutExtension(spineJson.name);
 			string assetPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(spineJson)).Replace('\\', '/');
 			string assetPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(spineJson)).Replace('\\', '/');
 			return assetPath + "/" + primaryName + SkeletonDataSuffix + ".asset";
 			return assetPath + "/" + primaryName + SkeletonDataSuffix + ".asset";
 		}
 		}
 
 
-		internal static SkeletonDataAsset IngestIncompatibleSpineProject(TextAsset spineJson,
+		internal static SkeletonDataAsset IngestIncompatibleSpineProject (TextAsset spineJson,
 			CompatibilityProblemInfo compatibilityProblemInfo) {
 			CompatibilityProblemInfo compatibilityProblemInfo) {
 
 
 			if (spineJson == null)
 			if (spineJson == null)
@@ -941,9 +934,9 @@ namespace Spine.Unity.Editor {
 			}
 			}
 #endif
 #endif
 		}
 		}
-#endregion
+		#endregion
 
 
-#region Spine Skeleton Data File Validation
+		#region Spine Skeleton Data File Validation
 		public static bool CheckForValidSkeletonData (string skeletonJSONPath) {
 		public static bool CheckForValidSkeletonData (string skeletonJSONPath) {
 			string dir = Path.GetDirectoryName(skeletonJSONPath).Replace('\\', '/');
 			string dir = Path.GetDirectoryName(skeletonJSONPath).Replace('\\', '/');
 			TextAsset textAsset = AssetDatabase.LoadAssetAtPath<TextAsset>(skeletonJSONPath);
 			TextAsset textAsset = AssetDatabase.LoadAssetAtPath<TextAsset>(skeletonJSONPath);
@@ -966,9 +959,9 @@ namespace Spine.Unity.Editor {
 			compatibilityProblemInfo = SkeletonDataCompatibility.GetCompatibilityProblemInfo(fileVersion);
 			compatibilityProblemInfo = SkeletonDataCompatibility.GetCompatibilityProblemInfo(fileVersion);
 			return isSpineSkeletonData;
 			return isSpineSkeletonData;
 		}
 		}
-#endregion
+		#endregion
 
 
-#region Dialogs
+		#region Dialogs
 		public static void SkeletonImportDialog (string skeletonPath, List<AtlasAssetBase> localAtlases, List<string> requiredPaths, ref bool abortSkeletonImport) {
 		public static void SkeletonImportDialog (string skeletonPath, List<AtlasAssetBase> localAtlases, List<string> requiredPaths, ref bool abortSkeletonImport) {
 			bool resolved = false;
 			bool resolved = false;
 			while (!resolved) {
 			while (!resolved) {
@@ -981,36 +974,36 @@ namespace Spine.Unity.Editor {
 				);
 				);
 
 
 				switch (result) {
 				switch (result) {
-					case -1:
-						//Debug.Log("Select Atlas");
-						AtlasAssetBase selectedAtlas = BrowseAtlasDialog(Path.GetDirectoryName(skeletonPath).Replace('\\', '/'));
-						if (selectedAtlas != null) {
-							localAtlases.Clear();
-							localAtlases.Add(selectedAtlas);
-							var atlasMatch = AssetUtility.GetMatchingAtlas(requiredPaths, localAtlases);
-							if (atlasMatch != null) {
-								resolved = true;
-								AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath<TextAsset>(skeletonPath), atlasMatch);
-							}
+				case -1:
+					//Debug.Log("Select Atlas");
+					AtlasAssetBase selectedAtlas = BrowseAtlasDialog(Path.GetDirectoryName(skeletonPath).Replace('\\', '/'));
+					if (selectedAtlas != null) {
+						localAtlases.Clear();
+						localAtlases.Add(selectedAtlas);
+						var atlasMatch = AssetUtility.GetMatchingAtlas(requiredPaths, localAtlases);
+						if (atlasMatch != null) {
+							resolved = true;
+							AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath<TextAsset>(skeletonPath), atlasMatch);
 						}
 						}
-						break;
-					case 0: // Resolve AtlasAssets...
-						var atlasList = MultiAtlasDialog(requiredPaths, Path.GetDirectoryName(skeletonPath).Replace('\\', '/'),
-							Path.GetFileNameWithoutExtension(skeletonPath));
-						if (atlasList != null)
-							AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath<TextAsset>(skeletonPath), atlasList.ToArray());
+					}
+					break;
+				case 0: // Resolve AtlasAssets...
+					var atlasList = MultiAtlasDialog(requiredPaths, Path.GetDirectoryName(skeletonPath).Replace('\\', '/'),
+						Path.GetFileNameWithoutExtension(skeletonPath));
+					if (atlasList != null)
+						AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath<TextAsset>(skeletonPath), atlasList.ToArray());
 
 
-						resolved = true;
-						break;
-					case 1: // Import without atlas
-						Debug.LogWarning("Imported with missing atlases. Skeleton will not render: " + Path.GetFileName(skeletonPath));
-						AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath<TextAsset>(skeletonPath), new AtlasAssetBase[] { });
-						resolved = true;
-						break;
-					case 2: // Stop importing all
-						abortSkeletonImport = true;
-						resolved = true;
-						break;
+					resolved = true;
+					break;
+				case 1: // Import without atlas
+					Debug.LogWarning("Imported with missing atlases. Skeleton will not render: " + Path.GetFileName(skeletonPath));
+					AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath<TextAsset>(skeletonPath), new AtlasAssetBase[] { });
+					resolved = true;
+					break;
+				case 2: // Stop importing all
+					abortSkeletonImport = true;
+					resolved = true;
+					break;
 				}
 				}
 			}
 			}
 		}
 		}
@@ -1069,29 +1062,29 @@ namespace Spine.Unity.Editor {
 				);
 				);
 
 
 				switch (result) {
 				switch (result) {
-					case 0: // Browse...
-						AtlasAssetBase selectedAtlasAsset = BrowseAtlasDialog(lastAtlasPath);
-						if (selectedAtlasAsset != null) {
-							if (!atlasAssets.Contains(selectedAtlasAsset)) {
-								var atlas = selectedAtlasAsset.GetAtlas();
-								bool hasValidRegion = false;
-								foreach (string str in missingRegions) {
-									if (atlas.FindRegion(str) != null) {
-										hasValidRegion = true;
-										break;
-									}
+				case 0: // Browse...
+					AtlasAssetBase selectedAtlasAsset = BrowseAtlasDialog(lastAtlasPath);
+					if (selectedAtlasAsset != null) {
+						if (!atlasAssets.Contains(selectedAtlasAsset)) {
+							var atlas = selectedAtlasAsset.GetAtlas();
+							bool hasValidRegion = false;
+							foreach (string str in missingRegions) {
+								if (atlas.FindRegion(str) != null) {
+									hasValidRegion = true;
+									break;
 								}
 								}
-								atlasAssets.Add(selectedAtlasAsset);
 							}
 							}
+							atlasAssets.Add(selectedAtlasAsset);
 						}
 						}
-						break;
-					case 1: // Import anyway
-						resolved = true;
-						break;
-					case 2: // Cancel
-						atlasAssets = null;
-						resolved = true;
-						break;
+					}
+					break;
+				case 1: // Import anyway
+					resolved = true;
+					break;
+				case 2: // Cancel
+					atlasAssets = null;
+					resolved = true;
+					break;
 				}
 				}
 			}
 			}
 
 
@@ -1114,7 +1107,7 @@ namespace Spine.Unity.Editor {
 
 
 			return (AtlasAssetBase)obj;
 			return (AtlasAssetBase)obj;
 		}
 		}
-#endregion
+		#endregion
 
 
 		public static string GetPathSafeName (string name) {
 		public static string GetPathSafeName (string name) {
 			foreach (char c in System.IO.Path.GetInvalidFileNameChars()) { // Doesn't handle more obscure file name limitations.
 			foreach (char c in System.IO.Path.GetInvalidFileNameChars()) { // Doesn't handle more obscure file name limitations.
@@ -1259,7 +1252,7 @@ namespace Spine.Unity.Editor {
 			EditorGUIUtility.PingObject(Selection.activeObject);
 			EditorGUIUtility.PingObject(Selection.activeObject);
 		}
 		}
 
 
-#region SkeletonMecanim
+		#region SkeletonMecanim
 #if SPINE_SKELETONMECANIM
 #if SPINE_SKELETONMECANIM
 		public static SkeletonMecanim InstantiateSkeletonMecanim (SkeletonDataAsset skeletonDataAsset, string skinName) {
 		public static SkeletonMecanim InstantiateSkeletonMecanim (SkeletonDataAsset skeletonDataAsset, string skinName) {
 			return InstantiateSkeletonMecanim(skeletonDataAsset, skeletonDataAsset.GetSkeletonData(true).FindSkin(skinName));
 			return InstantiateSkeletonMecanim(skeletonDataAsset, skeletonDataAsset.GetSkeletonData(true).FindSkin(skinName));
@@ -1315,6 +1308,6 @@ namespace Spine.Unity.Editor {
 			return newSkeletonMecanim;
 			return newSkeletonMecanim;
 		}
 		}
 #endif
 #endif
-#endregion
+		#endregion
 	}
 	}
 }
 }

+ 25 - 30
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/BlendModeMaterialsUtility.cs

@@ -30,11 +30,11 @@
 // from spine-unity 4.0 onward BlendModeMaterialAssets are obsolete and shall be upgraded.
 // from spine-unity 4.0 onward BlendModeMaterialAssets are obsolete and shall be upgraded.
 #define UPGRADE_ALL_BLEND_MODE_MATERIALS
 #define UPGRADE_ALL_BLEND_MODE_MATERIALS
 
 
-using UnityEngine;
-using UnityEditor;
+using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
-using System;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 
 
@@ -82,11 +82,9 @@ namespace Spine.Unity.Editor {
 					TransferSettingsFromModifierAsset(blendModesModifierAsset,
 					TransferSettingsFromModifierAsset(blendModesModifierAsset,
 					skeletonDataAsset, templateMaterials);
 					skeletonDataAsset, templateMaterials);
 					UpdateBlendmodeMaterialsRequiredState(skeletonDataAsset, skeletonData);
 					UpdateBlendmodeMaterialsRequiredState(skeletonDataAsset, skeletonData);
-				}
-				else
+				} else
 					return;
 					return;
-			}
-			else {
+			} else {
 				if (!UpdateBlendmodeMaterialsRequiredState(skeletonDataAsset, skeletonData))
 				if (!UpdateBlendmodeMaterialsRequiredState(skeletonDataAsset, skeletonData))
 					return;
 					return;
 				AssignPreferencesTemplateMaterials(templateMaterials);
 				AssignPreferencesTemplateMaterials(templateMaterials);
@@ -112,8 +110,7 @@ namespace Spine.Unity.Editor {
 			if (!skeletonDataAsset.blendModeMaterials.applyAdditiveMaterial) {
 			if (!skeletonDataAsset.blendModeMaterials.applyAdditiveMaterial) {
 				anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.additiveMaterials.Count > 0;
 				anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.additiveMaterials.Count > 0;
 				skeletonDataAsset.blendModeMaterials.additiveMaterials.Clear();
 				skeletonDataAsset.blendModeMaterials.additiveMaterials.Clear();
-			}
-			else
+			} else
 				anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.additiveMaterials.RemoveAll(ifMaterialMissing) != 0;
 				anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.additiveMaterials.RemoveAll(ifMaterialMissing) != 0;
 			anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.multiplyMaterials.RemoveAll(ifMaterialMissing) != 0;
 			anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.multiplyMaterials.RemoveAll(ifMaterialMissing) != 0;
 			anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.screenMaterials.RemoveAll(ifMaterialMissing) != 0;
 			anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.screenMaterials.RemoveAll(ifMaterialMissing) != 0;
@@ -181,21 +178,21 @@ namespace Spine.Unity.Editor {
 				Material materialTemplate = null;
 				Material materialTemplate = null;
 				string materialSuffix = null;
 				string materialSuffix = null;
 				switch (slot.BlendMode) {
 				switch (slot.BlendMode) {
-					case BlendMode.Multiply:
-						replacementMaterials = blendModeMaterials.multiplyMaterials;
-						materialTemplate = templateMaterials.multiplyTemplate;
-						materialSuffix = MATERIAL_SUFFIX_MULTIPLY;
-						break;
-					case BlendMode.Screen:
-						replacementMaterials = blendModeMaterials.screenMaterials;
-						materialTemplate = templateMaterials.screenTemplate;
-						materialSuffix = MATERIAL_SUFFIX_SCREEN;
-						break;
-					case BlendMode.Additive:
-						replacementMaterials = blendModeMaterials.additiveMaterials;
-						materialTemplate = templateMaterials.additiveTemplate;
-						materialSuffix = MATERIAL_SUFFIX_ADDITIVE;
-						break;
+				case BlendMode.Multiply:
+					replacementMaterials = blendModeMaterials.multiplyMaterials;
+					materialTemplate = templateMaterials.multiplyTemplate;
+					materialSuffix = MATERIAL_SUFFIX_MULTIPLY;
+					break;
+				case BlendMode.Screen:
+					replacementMaterials = blendModeMaterials.screenMaterials;
+					materialTemplate = templateMaterials.screenTemplate;
+					materialSuffix = MATERIAL_SUFFIX_SCREEN;
+					break;
+				case BlendMode.Additive:
+					replacementMaterials = blendModeMaterials.additiveMaterials;
+					materialTemplate = templateMaterials.additiveTemplate;
+					materialSuffix = MATERIAL_SUFFIX_ADDITIVE;
+					break;
 				}
 				}
 
 
 				skinEntries.Clear();
 				skinEntries.Clear();
@@ -218,9 +215,8 @@ namespace Spine.Unity.Editor {
 									Debug.Log(string.Format("Created blend mode Material '{0}' for SkeletonDataAsset '{1}'.",
 									Debug.Log(string.Format("Created blend mode Material '{0}' for SkeletonDataAsset '{1}'.",
 										replacement.material.name, skeletonDataAsset), replacement.material);
 										replacement.material.name, skeletonDataAsset), replacement.material);
 								}
 								}
-							}
-							else {
-								Debug.LogError(string.Format("Failed creating blend mode Material for SkeletonDataAsset '{0}',"+
+							} else {
+								Debug.LogError(string.Format("Failed creating blend mode Material for SkeletonDataAsset '{0}'," +
 									" atlas page '{1}', template '{2}'.",
 									" atlas page '{1}', template '{2}'.",
 									skeletonDataAsset.name, originalRegion.page.name, materialTemplate.name),
 									skeletonDataAsset.name, originalRegion.page.name, materialTemplate.name),
 									skeletonDataAsset);
 									skeletonDataAsset);
@@ -236,7 +232,7 @@ namespace Spine.Unity.Editor {
 			return !anyCreationFailed;
 			return !anyCreationFailed;
 		}
 		}
 
 
-		protected static string GetBlendModeMaterialPath(AtlasPage originalPage, string materialSuffix) {
+		protected static string GetBlendModeMaterialPath (AtlasPage originalPage, string materialSuffix) {
 			var originalMaterial = originalPage.rendererObject as Material;
 			var originalMaterial = originalPage.rendererObject as Material;
 			var originalPath = AssetDatabase.GetAssetPath(originalMaterial);
 			var originalPath = AssetDatabase.GetAssetPath(originalMaterial);
 			return originalPath.Replace(".mat", materialSuffix + ".mat");
 			return originalPath.Replace(".mat", materialSuffix + ".mat");
@@ -254,8 +250,7 @@ namespace Spine.Unity.Editor {
 			newReplacement.pageName = originalPage.name;
 			newReplacement.pageName = originalPage.name;
 			if (File.Exists(blendMaterialPath)) {
 			if (File.Exists(blendMaterialPath)) {
 				newReplacement.material = AssetDatabase.LoadAssetAtPath<Material>(blendMaterialPath);
 				newReplacement.material = AssetDatabase.LoadAssetAtPath<Material>(blendMaterialPath);
-			}
-			else {
+			} else {
 				var blendModeMaterial = new Material(materialTemplate) {
 				var blendModeMaterial = new Material(materialTemplate) {
 					name = originalMaterial.name + " " + materialTemplate.name,
 					name = originalMaterial.name + " " + materialTemplate.name,
 					mainTexture = originalMaterial.mainTexture
 					mainTexture = originalMaterial.mainTexture

+ 7 - 10
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/BuildSettings.cs

@@ -43,14 +43,14 @@
 #define NEWHIERARCHYWINDOWCALLBACKS
 #define NEWHIERARCHYWINDOWCALLBACKS
 #endif
 #endif
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.IO;
-using System.Text;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using System.Globalization;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	public partial class SpineEditorUtilities {
 	public partial class SpineEditorUtilities {
@@ -82,8 +82,7 @@ namespace Spine.Unity.Editor {
 		}
 		}
 	}
 	}
 
 
-	public static class SpineBuildEnvUtility
-	{
+	public static class SpineBuildEnvUtility {
 		static bool IsInvalidGroup (BuildTargetGroup group) {
 		static bool IsInvalidGroup (BuildTargetGroup group) {
 			int gi = (int)group;
 			int gi = (int)group;
 			return
 			return
@@ -115,8 +114,7 @@ namespace Spine.Unity.Editor {
 
 
 			if (wasDefineAdded) {
 			if (wasDefineAdded) {
 				Debug.LogWarning("Setting Scripting Define Symbol " + define);
 				Debug.LogWarning("Setting Scripting Define Symbol " + define);
-			}
-			else {
+			} else {
 				Debug.LogWarning("Already Set Scripting Define Symbol " + define);
 				Debug.LogWarning("Already Set Scripting Define Symbol " + define);
 			}
 			}
 			return wasDefineAdded;
 			return wasDefineAdded;
@@ -143,8 +141,7 @@ namespace Spine.Unity.Editor {
 
 
 			if (wasDefineRemoved) {
 			if (wasDefineRemoved) {
 				Debug.LogWarning("Removing Scripting Define Symbol " + define);
 				Debug.LogWarning("Removing Scripting Define Symbol " + define);
-			}
-			else {
+			} else {
 				Debug.LogWarning("Already Removed Scripting Define Symbol " + define);
 				Debug.LogWarning("Already Removed Scripting Define Symbol " + define);
 			}
 			}
 			return wasDefineRemoved;
 			return wasDefineRemoved;

+ 7 - 7
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/DataReloadHandler.cs

@@ -35,14 +35,14 @@
 #define NEWPLAYMODECALLBACKS
 #define NEWPLAYMODECALLBACKS
 #endif
 #endif
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.IO;
-using System.Text;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using System.Globalization;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 
 
@@ -51,11 +51,11 @@ namespace Spine.Unity.Editor {
 
 
 			internal static Dictionary<int, string> savedSkeletonDataAssetAtSKeletonGraphicID = new Dictionary<int, string>();
 			internal static Dictionary<int, string> savedSkeletonDataAssetAtSKeletonGraphicID = new Dictionary<int, string>();
 
 
-		#if NEWPLAYMODECALLBACKS
+#if NEWPLAYMODECALLBACKS
 			internal static void OnPlaymodeStateChanged (PlayModeStateChange stateChange) {
 			internal static void OnPlaymodeStateChanged (PlayModeStateChange stateChange) {
-		#else
+#else
 			internal static void OnPlaymodeStateChanged () {
 			internal static void OnPlaymodeStateChanged () {
-		#endif
+#endif
 				ReloadAllActiveSkeletonsEditMode();
 				ReloadAllActiveSkeletonsEditMode();
 			}
 			}
 
 

+ 4 - 4
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/Icons.cs

@@ -31,14 +31,14 @@
 
 
 #define SPINE_SKELETONMECANIM
 #define SPINE_SKELETONMECANIM
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.IO;
-using System.Text;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using System.Globalization;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	public partial class SpineEditorUtilities {
 	public partial class SpineEditorUtilities {

+ 5 - 6
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/Instantiation.cs

@@ -31,14 +31,14 @@
 
 
 #define SPINE_SKELETONMECANIM
 #define SPINE_SKELETONMECANIM
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.IO;
-using System.Text;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using System.Globalization;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using EventType = UnityEngine.EventType;
 	using EventType = UnityEngine.EventType;
@@ -155,8 +155,7 @@ namespace Spine.Unity.Editor {
 				if (isUI) {
 				if (isUI) {
 					if (usedParent != null && usedParent.GetComponent<RectTransform>() != null) {
 					if (usedParent != null && usedParent.GetComponent<RectTransform>() != null) {
 						((SkeletonGraphic)newSkeletonComponent).MatchRectTransformWithBounds();
 						((SkeletonGraphic)newSkeletonComponent).MatchRectTransformWithBounds();
-					}
-					else
+					} else
 						Debug.Log("Created a UI Skeleton GameObject not under a RectTransform. It may not be visible until you parent it to a canvas.");
 						Debug.Log("Created a UI Skeleton GameObject not under a RectTransform. It may not be visible until you parent it to a canvas.");
 				}
 				}
 
 

+ 14 - 14
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs

@@ -43,19 +43,19 @@
 #define NEW_PREFERENCES_SETTINGS_PROVIDER
 #define NEW_PREFERENCES_SETTINGS_PROVIDER
 #endif
 #endif
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.IO;
-using System.Text;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using System.Globalization;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	public partial class SpineEditorUtilities {
 	public partial class SpineEditorUtilities {
 
 
-	#if NEW_PREFERENCES_SETTINGS_PROVIDER
+#if NEW_PREFERENCES_SETTINGS_PROVIDER
 		static class SpineSettingsProviderRegistration
 		static class SpineSettingsProviderRegistration
 		{
 		{
 			[SettingsProvider]
 			[SettingsProvider]
@@ -79,27 +79,27 @@ namespace Spine.Unity.Editor {
 				return provider;
 				return provider;
 			}
 			}
 		}
 		}
-	#else
+#else
 		// Preferences entry point
 		// Preferences entry point
 		[PreferenceItem("Spine")]
 		[PreferenceItem("Spine")]
 		static void PreferencesGUI () {
 		static void PreferencesGUI () {
 			Preferences.HandlePreferencesGUI();
 			Preferences.HandlePreferencesGUI();
 		}
 		}
-	#endif
+#endif
 
 
-	#if NEW_PREFERENCES_SETTINGS_PROVIDER
+#if NEW_PREFERENCES_SETTINGS_PROVIDER
 		public static SpinePreferences Preferences {
 		public static SpinePreferences Preferences {
 			get {
 			get {
 				return SpinePreferences.GetOrCreateSettings();
 				return SpinePreferences.GetOrCreateSettings();
 			}
 			}
 		}
 		}
-	#endif
+#endif
 
 
-	#if NEW_PREFERENCES_SETTINGS_PROVIDER
+#if NEW_PREFERENCES_SETTINGS_PROVIDER
 		public static class OldPreferences {
 		public static class OldPreferences {
-	#else
+#else
 		public static class Preferences {
 		public static class Preferences {
-	#endif
+#endif
 			const string DEFAULT_SCALE_KEY = "SPINE_DEFAULT_SCALE";
 			const string DEFAULT_SCALE_KEY = "SPINE_DEFAULT_SCALE";
 			public static float defaultScale = SpinePreferences.DEFAULT_DEFAULT_SCALE;
 			public static float defaultScale = SpinePreferences.DEFAULT_DEFAULT_SCALE;
 
 
@@ -423,12 +423,12 @@ namespace Spine.Unity.Editor {
 			property.stringValue = material ? AssetDatabase.GetAssetPath(material) : "";
 			property.stringValue = material ? AssetDatabase.GetAssetPath(material) : "";
 		}
 		}
 
 
-	#if NEW_PREFERENCES_SETTINGS_PROVIDER
+#if NEW_PREFERENCES_SETTINGS_PROVIDER
 		public static void PresetAssetPropertyField (SerializedProperty property, GUIContent label) {
 		public static void PresetAssetPropertyField (SerializedProperty property, GUIContent label) {
 			var texturePreset = (EditorGUILayout.ObjectField(label, AssetDatabase.LoadAssetAtPath<UnityEditor.Presets.Preset>(property.stringValue), typeof(UnityEditor.Presets.Preset), false) as UnityEditor.Presets.Preset);
 			var texturePreset = (EditorGUILayout.ObjectField(label, AssetDatabase.LoadAssetAtPath<UnityEditor.Presets.Preset>(property.stringValue), typeof(UnityEditor.Presets.Preset), false) as UnityEditor.Presets.Preset);
 			bool isTexturePreset = texturePreset != null && texturePreset.GetTargetTypeName() == "TextureImporter";
 			bool isTexturePreset = texturePreset != null && texturePreset.GetTargetTypeName() == "TextureImporter";
 			property.stringValue = isTexturePreset ? AssetDatabase.GetAssetPath(texturePreset) : "";
 			property.stringValue = isTexturePreset ? AssetDatabase.GetAssetPath(texturePreset) : "";
 		}
 		}
-	#endif
+#endif
 	}
 	}
 }
 }

+ 7 - 12
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineBuildProcessor.cs

@@ -36,25 +36,23 @@
 #define HAS_ON_POSTPROCESS_PREFAB
 #define HAS_ON_POSTPROCESS_PREFAB
 #endif
 #endif
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using UnityEditor;
 using UnityEditor.Build;
 using UnityEditor.Build;
+using UnityEngine;
 #if HAS_BUILD_PROCESS_WITH_REPORT
 #if HAS_BUILD_PROCESS_WITH_REPORT
 using UnityEditor.Build.Reporting;
 using UnityEditor.Build.Reporting;
 #endif
 #endif
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
-	public class SpineBuildProcessor
-	{
+	public class SpineBuildProcessor {
 		internal static bool isBuilding = false;
 		internal static bool isBuilding = false;
 
 
 #if HAS_ON_POSTPROCESS_PREFAB
 #if HAS_ON_POSTPROCESS_PREFAB
 		static List<string> prefabsToRestore = new List<string>();
 		static List<string> prefabsToRestore = new List<string>();
 #endif
 #endif
 
 
-		internal static void PreprocessBuild()
-		{
+		internal static void PreprocessBuild () {
 			isBuilding = true;
 			isBuilding = true;
 #if HAS_ON_POSTPROCESS_PREFAB
 #if HAS_ON_POSTPROCESS_PREFAB
 			var assets = AssetDatabase.FindAssets("t:Prefab");
 			var assets = AssetDatabase.FindAssets("t:Prefab");
@@ -69,8 +67,7 @@ namespace Spine.Unity.Editor {
 #endif
 #endif
 		}
 		}
 
 
-		internal static void PostprocessBuild()
-		{
+		internal static void PostprocessBuild () {
 			isBuilding = false;
 			isBuilding = false;
 #if HAS_ON_POSTPROCESS_PREFAB
 #if HAS_ON_POSTPROCESS_PREFAB
 			foreach (string assetPath in prefabsToRestore) {
 			foreach (string assetPath in prefabsToRestore) {
@@ -98,8 +95,7 @@ namespace Spine.Unity.Editor {
 			SpineBuildProcessor.PreprocessBuild();
 			SpineBuildProcessor.PreprocessBuild();
 		}
 		}
 #else
 #else
-		void IPreprocessBuild.OnPreprocessBuild(BuildTarget target, string path)
-		{
+		void IPreprocessBuild.OnPreprocessBuild (BuildTarget target, string path) {
 			SpineBuildProcessor.PreprocessBuild();
 			SpineBuildProcessor.PreprocessBuild();
 		}
 		}
 #endif
 #endif
@@ -123,8 +119,7 @@ namespace Spine.Unity.Editor {
 			SpineBuildProcessor.PostprocessBuild();
 			SpineBuildProcessor.PostprocessBuild();
 		}
 		}
 #else
 #else
-		void IPostprocessBuild.OnPostprocessBuild(BuildTarget target, string path)
-		{
+		void IPostprocessBuild.OnPostprocessBuild (BuildTarget target, string path) {
 			SpineBuildProcessor.PostprocessBuild();
 			SpineBuildProcessor.PostprocessBuild();
 		}
 		}
 #endif
 #endif

+ 27 - 31
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs

@@ -54,14 +54,14 @@
 #define HAS_ON_POSTPROCESS_PREFAB
 #define HAS_ON_POSTPROCESS_PREFAB
 #endif
 #endif
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.IO;
-using System.Text;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using System.Globalization;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using EventType = UnityEngine.EventType;
 	using EventType = UnityEngine.EventType;
@@ -77,11 +77,11 @@ namespace Spine.Unity.Editor {
 
 
 		// Auto-import entry point for textures
 		// Auto-import entry point for textures
 		void OnPreprocessTexture () {
 		void OnPreprocessTexture () {
-		#if UNITY_2018_1_OR_NEWER
+#if UNITY_2018_1_OR_NEWER
 			bool customTextureSettingsExist = !assetImporter.importSettingsMissing;
 			bool customTextureSettingsExist = !assetImporter.importSettingsMissing;
-		#else
+#else
 			bool customTextureSettingsExist = System.IO.File.Exists(assetImporter.assetPath + ".meta");
 			bool customTextureSettingsExist = System.IO.File.Exists(assetImporter.assetPath + ".meta");
-		#endif
+#endif
 			if (!customTextureSettingsExist) {
 			if (!customTextureSettingsExist) {
 				texturesWithoutMetaFile.Add(assetImporter.assetPath);
 				texturesWithoutMetaFile.Add(assetImporter.assetPath);
 			}
 			}
@@ -159,11 +159,11 @@ namespace Spine.Unity.Editor {
 		static void Initialize () {
 		static void Initialize () {
 			// Note: Preferences need to be loaded when changing play mode
 			// Note: Preferences need to be loaded when changing play mode
 			// to initialize handle scale correctly.
 			// to initialize handle scale correctly.
-			#if !NEW_PREFERENCES_SETTINGS_PROVIDER
+#if !NEW_PREFERENCES_SETTINGS_PROVIDER
 			Preferences.Load();
 			Preferences.Load();
-			#else
+#else
 			SpinePreferences.Load();
 			SpinePreferences.Load();
-			#endif
+#endif
 
 
 			if (EditorApplication.isPlayingOrWillChangePlaymode) return;
 			if (EditorApplication.isPlayingOrWillChangePlaymode) return;
 
 
@@ -175,46 +175,45 @@ namespace Spine.Unity.Editor {
 			if (assets.Length > 0) {
 			if (assets.Length > 0) {
 				assetPath = AssetDatabase.GUIDToAssetPath(assets[0]);
 				assetPath = AssetDatabase.GUIDToAssetPath(assets[0]);
 				editorGUIPath = Path.GetDirectoryName(assetPath).Replace('\\', '/');
 				editorGUIPath = Path.GetDirectoryName(assetPath).Replace('\\', '/');
-			}
-			else {
+			} else {
 				editorGUIPath = editorPath.Replace("/Utility", "/GUI");
 				editorGUIPath = editorPath.Replace("/Utility", "/GUI");
 			}
 			}
 			Icons.Initialize();
 			Icons.Initialize();
 
 
 			// Drag and Drop
 			// Drag and Drop
-		#if UNITY_2019_1_OR_NEWER
+#if UNITY_2019_1_OR_NEWER
 			SceneView.duringSceneGui -= DragAndDropInstantiation.SceneViewDragAndDrop;
 			SceneView.duringSceneGui -= DragAndDropInstantiation.SceneViewDragAndDrop;
 			SceneView.duringSceneGui += DragAndDropInstantiation.SceneViewDragAndDrop;
 			SceneView.duringSceneGui += DragAndDropInstantiation.SceneViewDragAndDrop;
-		#else
+#else
 			SceneView.onSceneGUIDelegate -= DragAndDropInstantiation.SceneViewDragAndDrop;
 			SceneView.onSceneGUIDelegate -= DragAndDropInstantiation.SceneViewDragAndDrop;
 			SceneView.onSceneGUIDelegate += DragAndDropInstantiation.SceneViewDragAndDrop;
 			SceneView.onSceneGUIDelegate += DragAndDropInstantiation.SceneViewDragAndDrop;
-		#endif
+#endif
 
 
 			EditorApplication.hierarchyWindowItemOnGUI -= HierarchyHandler.HandleDragAndDrop;
 			EditorApplication.hierarchyWindowItemOnGUI -= HierarchyHandler.HandleDragAndDrop;
 			EditorApplication.hierarchyWindowItemOnGUI += HierarchyHandler.HandleDragAndDrop;
 			EditorApplication.hierarchyWindowItemOnGUI += HierarchyHandler.HandleDragAndDrop;
 
 
 			// Hierarchy Icons
 			// Hierarchy Icons
-			#if NEWPLAYMODECALLBACKS
+#if NEWPLAYMODECALLBACKS
 			EditorApplication.playModeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged;
 			EditorApplication.playModeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged;
 			EditorApplication.playModeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged;
 			EditorApplication.playModeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged;
 			HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
 			HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
-			#else
+#else
 			EditorApplication.playmodeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged;
 			EditorApplication.playmodeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged;
 			EditorApplication.playmodeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged;
 			EditorApplication.playmodeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged;
 			HierarchyHandler.IconsOnPlaymodeStateChanged();
 			HierarchyHandler.IconsOnPlaymodeStateChanged();
-			#endif
+#endif
 
 
 			// Data Refresh Edit Mode.
 			// Data Refresh Edit Mode.
 			// This prevents deserialized SkeletonData from persisting from play mode to edit mode.
 			// This prevents deserialized SkeletonData from persisting from play mode to edit mode.
-			#if NEWPLAYMODECALLBACKS
+#if NEWPLAYMODECALLBACKS
 			EditorApplication.playModeStateChanged -= DataReloadHandler.OnPlaymodeStateChanged;
 			EditorApplication.playModeStateChanged -= DataReloadHandler.OnPlaymodeStateChanged;
 			EditorApplication.playModeStateChanged += DataReloadHandler.OnPlaymodeStateChanged;
 			EditorApplication.playModeStateChanged += DataReloadHandler.OnPlaymodeStateChanged;
 			DataReloadHandler.OnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
 			DataReloadHandler.OnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode);
-			#else
+#else
 			EditorApplication.playmodeStateChanged -= DataReloadHandler.OnPlaymodeStateChanged;
 			EditorApplication.playmodeStateChanged -= DataReloadHandler.OnPlaymodeStateChanged;
 			EditorApplication.playmodeStateChanged += DataReloadHandler.OnPlaymodeStateChanged;
 			EditorApplication.playmodeStateChanged += DataReloadHandler.OnPlaymodeStateChanged;
 			DataReloadHandler.OnPlaymodeStateChanged();
 			DataReloadHandler.OnPlaymodeStateChanged();
-			#endif
+#endif
 
 
 			if (SpineEditorUtilities.Preferences.textureImporterWarning) {
 			if (SpineEditorUtilities.Preferences.textureImporterWarning) {
 				IssueWarningsForUnrecommendedTextureSettings();
 				IssueWarningsForUnrecommendedTextureSettings();
@@ -228,7 +227,7 @@ namespace Spine.Unity.Editor {
 				Initialize();
 				Initialize();
 		}
 		}
 
 
-		public static void IssueWarningsForUnrecommendedTextureSettings() {
+		public static void IssueWarningsForUnrecommendedTextureSettings () {
 
 
 			string[] atlasDescriptionGUIDs = AssetDatabase.FindAssets("t:textasset .atlas"); // Note: finds ".atlas.txt" but also ".atlas 1.txt" files.
 			string[] atlasDescriptionGUIDs = AssetDatabase.FindAssets("t:textasset .atlas"); // Note: finds ".atlas.txt" but also ".atlas 1.txt" files.
 			for (int i = 0; i < atlasDescriptionGUIDs.Length; ++i) {
 			for (int i = 0; i < atlasDescriptionGUIDs.Length; ++i) {
@@ -288,9 +287,9 @@ namespace Spine.Unity.Editor {
 				stateComponent.AnimationState.AssignEventSubscribersFrom(oldAnimationState);
 				stateComponent.AnimationState.AssignEventSubscribersFrom(oldAnimationState);
 			}
 			}
 
 
-		#if BUILT_IN_SPRITE_MASK_COMPONENT
+#if BUILT_IN_SPRITE_MASK_COMPONENT
 			SpineMaskUtilities.EditorAssignSpriteMaskMaterials(component);
 			SpineMaskUtilities.EditorAssignSpriteMaskMaterials(component);
-		#endif
+#endif
 			component.LateUpdate();
 			component.LateUpdate();
 		}
 		}
 
 
@@ -305,8 +304,7 @@ namespace Spine.Unity.Editor {
 			return asset != null && asset.GetSkeletonData(quiet: true) != null;
 			return asset != null && asset.GetSkeletonData(quiet: true) != null;
 		}
 		}
 
 
-		public static bool IssueWarningsForUnrecommendedTextureSettings(string texturePath)
-		{
+		public static bool IssueWarningsForUnrecommendedTextureSettings (string texturePath) {
 			TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath);
 			TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath);
 			if (texImporter == null) {
 			if (texImporter == null) {
 				return false;
 				return false;
@@ -321,7 +319,7 @@ namespace Spine.Unity.Editor {
 
 
 			string errorMessage = null;
 			string errorMessage = null;
 			if (MaterialChecks.IsTextureSetupProblematic(material, PlayerSettings.colorSpace,
 			if (MaterialChecks.IsTextureSetupProblematic(material, PlayerSettings.colorSpace,
-				texImporter. sRGBTexture, texImporter. mipmapEnabled, texImporter. alphaIsTransparency,
+				texImporter.sRGBTexture, texImporter.mipmapEnabled, texImporter.alphaIsTransparency,
 				texturePath, materialPath, ref errorMessage)) {
 				texturePath, materialPath, ref errorMessage)) {
 				Debug.LogWarning(errorMessage, material);
 				Debug.LogWarning(errorMessage, material);
 			}
 			}
@@ -492,10 +490,8 @@ namespace Spine.Unity.Editor {
 		}
 		}
 	}
 	}
 
 
-	public class TextureModificationWarningProcessor : UnityEditor.AssetModificationProcessor
-	{
-		static string[] OnWillSaveAssets(string[] paths)
-		{
+	public class TextureModificationWarningProcessor : UnityEditor.AssetModificationProcessor {
+		static string[] OnWillSaveAssets (string[] paths) {
 			if (SpineEditorUtilities.Preferences.textureImporterWarning) {
 			if (SpineEditorUtilities.Preferences.textureImporterWarning) {
 				foreach (string path in paths) {
 				foreach (string path in paths) {
 					if ((path != null) &&
 					if ((path != null) &&

+ 38 - 38
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineHandles.cs

@@ -31,23 +31,23 @@
 
 
 #define SPINE_SKELETONMECANIM
 #define SPINE_SKELETONMECANIM
 
 
-using UnityEngine;
-using UnityEditor;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.IO;
-using System.Text;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using System.Globalization;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using EventType = UnityEngine.EventType;
 	using EventType = UnityEngine.EventType;
 
 
 	public static class SpineHandles {
 	public static class SpineHandles {
 		public static Color BoneColor { get { return new Color(0.8f, 0.8f, 0.8f, 0.4f); } }
 		public static Color BoneColor { get { return new Color(0.8f, 0.8f, 0.8f, 0.4f); } }
-		public static Color PathColor { get { return new Color(254/255f, 127/255f, 0); } }
-		public static Color TransformContraintColor { get { return new Color(170/255f, 226/255f, 35/255f); } }
-		public static Color IkColor { get { return new Color(228/255f,90/255f,43/255f); } }
+		public static Color PathColor { get { return new Color(254 / 255f, 127 / 255f, 0); } }
+		public static Color TransformContraintColor { get { return new Color(170 / 255f, 226 / 255f, 35 / 255f); } }
+		public static Color IkColor { get { return new Color(228 / 255f, 90 / 255f, 43 / 255f); } }
 		public static Color PointColor { get { return new Color(1f, 1f, 0f, 1f); } }
 		public static Color PointColor { get { return new Color(1f, 1f, 0f, 1f); } }
 
 
 		static Vector3[] _boneMeshVerts = {
 		static Vector3[] _boneMeshVerts = {
@@ -63,7 +63,7 @@ namespace Spine.Unity.Editor {
 					_boneMesh = new Mesh {
 					_boneMesh = new Mesh {
 						vertices = _boneMeshVerts,
 						vertices = _boneMeshVerts,
 						uv = new Vector2[4],
 						uv = new Vector2[4],
-						triangles = new [] { 0, 1, 2, 2, 3, 0 }
+						triangles = new[] { 0, 1, 2, 2, 3, 0 }
 					};
 					};
 					_boneMesh.RecalculateBounds();
 					_boneMesh.RecalculateBounds();
 					_boneMesh.RecalculateNormals();
 					_boneMesh.RecalculateNormals();
@@ -77,13 +77,13 @@ namespace Spine.Unity.Editor {
 			get {
 			get {
 				if (_arrowheadMesh == null) {
 				if (_arrowheadMesh == null) {
 					_arrowheadMesh = new Mesh {
 					_arrowheadMesh = new Mesh {
-						vertices = new [] {
+						vertices = new[] {
 							new Vector3(0, 0),
 							new Vector3(0, 0),
 							new Vector3(-0.1f, 0.05f),
 							new Vector3(-0.1f, 0.05f),
 							new Vector3(-0.1f, -0.05f)
 							new Vector3(-0.1f, -0.05f)
 						},
 						},
 						uv = new Vector2[3],
 						uv = new Vector2[3],
-						triangles = new [] { 0, 1, 2 }
+						triangles = new[] { 0, 1, 2 }
 					};
 					};
 					_arrowheadMesh.RecalculateBounds();
 					_arrowheadMesh.RecalculateBounds();
 					_arrowheadMesh.RecalculateNormals();
 					_arrowheadMesh.RecalculateNormals();
@@ -269,10 +269,10 @@ namespace Spine.Unity.Editor {
 			int n = worldVerticesLength - step;
 			int n = worldVerticesLength - step;
 			Vector3 p0, p1, p2, p3;
 			Vector3 p0, p1, p2, p3;
 			for (int i = 2; i < n; i += step) {
 			for (int i = 2; i < n; i += step) {
-				p0 = m.MultiplyPoint(new Vector3(pv[i], pv[i+1]));
-				p1 = m.MultiplyPoint(new Vector3(pv[i+2], pv[i+3]));
-				p2 = m.MultiplyPoint(new Vector3(pv[i+4], pv[i+5]));
-				p3 = m.MultiplyPoint(new Vector3(pv[i+6], pv[i+7]));
+				p0 = m.MultiplyPoint(new Vector3(pv[i], pv[i + 1]));
+				p1 = m.MultiplyPoint(new Vector3(pv[i + 2], pv[i + 3]));
+				p2 = m.MultiplyPoint(new Vector3(pv[i + 4], pv[i + 5]));
+				p3 = m.MultiplyPoint(new Vector3(pv[i + 6], pv[i + 7]));
 				DrawCubicBezier(p0, p1, p2, p3);
 				DrawCubicBezier(p0, p1, p2, p3);
 			}
 			}
 
 
@@ -290,7 +290,7 @@ namespace Spine.Unity.Editor {
 			SpineHandles.DrawDot(firstPoint, endCapSize);
 			SpineHandles.DrawDot(firstPoint, endCapSize);
 
 
 			//if (!p.Closed) SpineHandles.DrawDot(m.MultiplyPoint(new Vector3(pv[n - 4], pv[n - 3])), endCapSize);
 			//if (!p.Closed) SpineHandles.DrawDot(m.MultiplyPoint(new Vector3(pv[n - 4], pv[n - 3])), endCapSize);
-			if (includeName) Handles.Label(firstPoint + new Vector3(0,0.1f), p.Name, PathNameStyle);
+			if (includeName) Handles.Label(firstPoint + new Vector3(0, 0.1f), p.Name, PathNameStyle);
 
 
 			Handles.color = ocolor;
 			Handles.color = ocolor;
 		}
 		}
@@ -385,30 +385,30 @@ namespace Spine.Unity.Editor {
 					pos = bones.Items[0].GetWorldPosition(transform, skeletonRenderScale);
 					pos = bones.Items[0].GetWorldPosition(transform, skeletonRenderScale);
 					switch (bones.Count) {
 					switch (bones.Count) {
 					case 1: {
 					case 1: {
-							Handles.color = handleColor;
-							Handles.DrawLine(targetPos, pos);
-							SpineHandles.DrawBoneCircle(targetPos, handleColor, normal);
-							var m = bones.Items[0].GetMatrix4x4();
-							m.m03 = targetBone.WorldX * skeletonRenderScale;
-							m.m13 = targetBone.WorldY * skeletonRenderScale;
-							SpineHandles.DrawArrowhead(transform.localToWorldMatrix * m);
-							break;
-						}
+						Handles.color = handleColor;
+						Handles.DrawLine(targetPos, pos);
+						SpineHandles.DrawBoneCircle(targetPos, handleColor, normal);
+						var m = bones.Items[0].GetMatrix4x4();
+						m.m03 = targetBone.WorldX * skeletonRenderScale;
+						m.m13 = targetBone.WorldY * skeletonRenderScale;
+						SpineHandles.DrawArrowhead(transform.localToWorldMatrix * m);
+						break;
+					}
 					case 2: {
 					case 2: {
-							Bone childBone = bones.Items[1];
-							Vector3 child = childBone.GetWorldPosition(transform, skeletonRenderScale);
-							Handles.color = handleColor;
-							Handles.DrawLine(child, pos);
-							Handles.DrawLine(targetPos, child);
-							SpineHandles.DrawBoneCircle(pos, handleColor, normal, 0.5f);
-							SpineHandles.DrawBoneCircle(child, handleColor, normal, 0.5f);
-							SpineHandles.DrawBoneCircle(targetPos, handleColor, normal);
-							var m = childBone.GetMatrix4x4();
-							m.m03 = targetBone.WorldX * skeletonRenderScale;
-							m.m13 = targetBone.WorldY * skeletonRenderScale;
-							SpineHandles.DrawArrowhead(transform.localToWorldMatrix * m);
-							break;
-						}
+						Bone childBone = bones.Items[1];
+						Vector3 child = childBone.GetWorldPosition(transform, skeletonRenderScale);
+						Handles.color = handleColor;
+						Handles.DrawLine(child, pos);
+						Handles.DrawLine(targetPos, child);
+						SpineHandles.DrawBoneCircle(pos, handleColor, normal, 0.5f);
+						SpineHandles.DrawBoneCircle(child, handleColor, normal, 0.5f);
+						SpineHandles.DrawBoneCircle(targetPos, handleColor, normal);
+						var m = childBone.GetMatrix4x4();
+						m.m03 = targetBone.WorldX * skeletonRenderScale;
+						m.m13 = targetBone.WorldY * skeletonRenderScale;
+						SpineHandles.DrawArrowhead(transform.localToWorldMatrix * m);
+						break;
+					}
 					}
 					}
 				}
 				}
 				//Handles.Label(targetPos, ikc.Data.Name, SpineHandles.BoneNameStyle);
 				//Handles.Label(targetPos, ikc.Data.Name, SpineHandles.BoneNameStyle);

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác