mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] SkeletonUtilityInspector uses new handles.
This commit is contained in:
parent
2c8f291d7b
commit
204050e1c2
@ -98,13 +98,19 @@ namespace Spine.Unity.Editor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var m = transform.localToWorldMatrix;
|
||||||
foreach (Bone b in skeleton.Bones) {
|
foreach (Bone b in skeleton.Bones) {
|
||||||
Vector3 pos = new Vector3(b.WorldX, b.WorldY, 0);
|
Vector3 pos = new Vector3(b.WorldX, b.WorldY, 0);
|
||||||
Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX - 90f);
|
Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX - 90f);
|
||||||
Vector3 scale = Vector3.one * b.Data.Length * b.WorldScaleX;
|
Vector3 scale = Vector3.one * b.Data.Length * b.WorldScaleX;
|
||||||
|
const float mx = 2.5f;
|
||||||
|
scale.x = Mathf.Clamp(scale.x, -mx, mx);
|
||||||
|
SpineEditorUtilities.DrawBone(m * Matrix4x4.TRS(pos, rot, scale));
|
||||||
|
}
|
||||||
|
|
||||||
SpineEditorUtilities.Icons.BoneMaterial.SetPass(0);
|
foreach (Slot s in skeleton.DrawOrder) {
|
||||||
Graphics.DrawMeshNow(SpineEditorUtilities.Icons.BoneMesh, transform.localToWorldMatrix * Matrix4x4.TRS(pos, rot, scale));
|
var p = s.Attachment as PathAttachment;
|
||||||
|
if (p != null) SpineEditorUtilities.DrawPath(s, p, transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user