mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
[csharp] Minor cleanup.
This commit is contained in:
parent
1e7b9a1083
commit
7e910cb8f7
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user