diff --git a/spine-csharp/src/Posed.cs b/spine-csharp/src/Posed.cs index cdcc0bdb8..bde8427ab 100644 --- a/spine-csharp/src/Posed.cs +++ b/spine-csharp/src/Posed.cs @@ -30,8 +30,7 @@ using System; namespace Spine { - - public interface IPosed { + internal interface IPosedInternal { // replaces "object.pose == object.applied" of reference implementation. bool PoseEqualsApplied { get; } // replaces "object.applied = object.pose" of reference implementation. @@ -40,10 +39,13 @@ namespace Spine { void UseConstrained (); // replaces "object.applied.Set(object.pose)" of reference implementation. void ResetConstrained (); + } + + public interface IPosed { void SetupPose (); } - public class Posed : IPosed + public class Posed : IPosed, IPosedInternal where D : PosedData

where P : IPose

where A : P { @@ -65,19 +67,19 @@ namespace Spine { pose.Set(data.setup); } - public bool PoseEqualsApplied { + bool IPosedInternal.PoseEqualsApplied { get { return (object)pose == (object)applied; } } - public void UsePose () { + void IPosedInternal.UsePose () { applied = pose; } - public void UseConstrained () { + void IPosedInternal.UseConstrained () { applied = constrained; } - public void ResetConstrained () { + void IPosedInternal.ResetConstrained () { applied.Set(pose); } diff --git a/spine-csharp/src/Skeleton.cs b/spine-csharp/src/Skeleton.cs index 7639b129a..988f4cdad 100644 --- a/spine-csharp/src/Skeleton.cs +++ b/spine-csharp/src/Skeleton.cs @@ -46,7 +46,7 @@ namespace Spine { internal ExposedList constraints; internal ExposedList physics; internal ExposedList updateCache = new ExposedList(); - internal ExposedList resetCache = new ExposedList(16); + internal ExposedList resetCache = new ExposedList(16); internal Skin skin; // Color is a struct, set to protected to prevent // Color color = slot.color; color.a = 0.5; @@ -156,7 +156,7 @@ namespace Spine { Slot[] slots = this.slots.Items; for (int i = 0, n = this.slots.Count; i < n; i++) { - slots[i].UsePose(); + ((IPosedInternal)slots[i]).UsePose(); } int boneCount = this.bones.Count; @@ -165,7 +165,7 @@ namespace Spine { Bone bone = bones[i]; bone.sorted = bone.data.skinRequired; bone.active = !bone.sorted; - bone.UsePose(); + ((IPosedInternal)bone).UsePose(); } if (skin != null) { BoneData[] skinBones = skin.bones.Items; @@ -183,7 +183,7 @@ namespace Spine { { // scope added to prevent compile error of n already being declared in enclosing scope int n = this.constraints.Count; for (int i = 0; i < n; i++) { - constraints[i].UsePose(); + ((IPosedInternal)constraints[i]).UsePose(); } for (int i = 0; i < n; i++) { IConstraint constraint = constraints[i]; @@ -204,7 +204,7 @@ namespace Spine { } } - internal void Constrained (IPosed obj) { + internal void Constrained (IPosedInternal obj) { if (obj.PoseEqualsApplied) { // if (obj.pose == obj.applied) { obj.UseConstrained(); resetCache.Add(obj); @@ -239,7 +239,7 @@ namespace Spine { public void UpdateWorldTransform (Physics physics) { update++; - IPosed[] resetCache = this.resetCache.Items; + IPosedInternal[] resetCache = this.resetCache.Items; for (int i = 0, n = this.resetCache.Count; i < n; i++) { resetCache[i].ResetConstrained(); } diff --git a/spine-csharp/src/Slider.cs b/spine-csharp/src/Slider.cs index d0aef0142..19ca8dc84 100644 --- a/spine-csharp/src/Slider.cs +++ b/spine-csharp/src/Slider.cs @@ -102,10 +102,10 @@ namespace Spine { for (int ii = 0; ii < physicsCount; ii++) skeleton.Constrained(physics[ii]); } else - skeleton.Constrained(constraints[timeline.constraintIndex]); + skeleton.Constrained((IPosedInternal)constraints[timeline.constraintIndex]); } else if (t as IConstraintTimeline != null) { IConstraintTimeline timeline = (IConstraintTimeline)t; - skeleton.Constrained(constraints[timeline.ConstraintIndex]); + skeleton.Constrained((IPosedInternal)constraints[timeline.ConstraintIndex]); } } } diff --git a/spine-csharp/src/package.json b/spine-csharp/src/package.json index 5ead0a3e2..dcd2fcd5d 100644 --- a/spine-csharp/src/package.json +++ b/spine-csharp/src/package.json @@ -2,7 +2,7 @@ "name": "com.esotericsoftware.spine.spine-csharp", "displayName": "spine-csharp Runtime", "description": "This plugin provides the spine-csharp core runtime.", - "version": "4.3.3", + "version": "4.3.4", "unity": "2018.3", "author": { "name": "Esoteric Software",