[csharp] Minor cleanup.

This commit is contained in:
pharan 2018-04-20 12:18:36 +08:00
parent 1e7b9a1083
commit 7e910cb8f7
2 changed files with 3 additions and 7 deletions

View File

@ -47,16 +47,16 @@ namespace Spine {
public float DefaultMix { get { return defaultMix; } set { defaultMix = value; } }
public AnimationStateData (SkeletonData skeletonData) {
if (skeletonData == null) throw new ArgumentException ("skeletonData cannot be null.");
if (skeletonData == null) throw new ArgumentException("skeletonData cannot be null.", "skeletonData");
this.skeletonData = skeletonData;
}
/// <summary>Sets a mix duration by animation names.</summary>
public void SetMix (string fromName, string toName, float duration) {
Animation from = skeletonData.FindAnimation(fromName);
if (from == null) throw new ArgumentException("Animation not found: " + fromName);
if (from == null) throw new ArgumentException("Animation not found: " + fromName, "fromName");
Animation to = skeletonData.FindAnimation(toName);
if (to == null) throw new ArgumentException("Animation not found: " + toName);
if (to == null) throw new ArgumentException("Animation not found: " + toName, "toName");
SetMix(from, to, duration);
}

View File

@ -173,16 +173,12 @@ namespace Spine {
d = ld;
worldX = x + skeleton.x;
worldY = y + skeleton.y;
// worldSignX = Math.Sign(scaleX);
// worldSignY = Math.Sign(scaleY);
return;
}
float pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;
worldX = pa * x + pb * y + parent.worldX;
worldY = pc * x + pd * y + parent.worldY;
// worldSignX = parent.worldSignX * Math.Sign(scaleX);
// worldSignY = parent.worldSignY * Math.Sign(scaleY);
switch (data.transformMode) {
case TransformMode.Normal: {