mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[Unity] Fix SkeletonUtility debug bone scale.
This commit is contained in:
parent
fc8505ff81
commit
c311a5aa2e
@ -90,10 +90,7 @@ namespace Spine.Unity.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateAttachments();
|
UpdateAttachments();
|
||||||
|
isPrefab |= PrefabUtility.GetPrefabType(this.target) == PrefabType.Prefab;
|
||||||
if (PrefabUtility.GetPrefabType(this.target) == PrefabType.Prefab)
|
|
||||||
isPrefab = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnSceneGUI () {
|
void OnSceneGUI () {
|
||||||
@ -102,20 +99,13 @@ namespace Spine.Unity.Editor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// MITCH
|
|
||||||
//float flipRotation = skeleton.FlipX ? -1 : 1;
|
|
||||||
const float flipRotation = 1;
|
|
||||||
|
|
||||||
foreach (Bone b in skeleton.Bones) {
|
foreach (Bone b in skeleton.Bones) {
|
||||||
Vector3 vec = transform.TransformPoint(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);
|
||||||
// MITCH
|
Vector3 scale = Vector3.one * b.Data.Length * b.WorldScaleX;
|
||||||
Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX * flipRotation);
|
|
||||||
Vector3 forward = transform.TransformDirection(rot * Vector3.right);
|
|
||||||
forward *= flipRotation;
|
|
||||||
|
|
||||||
SpineEditorUtilities.Icons.BoneMaterial.SetPass(0);
|
SpineEditorUtilities.Icons.BoneMaterial.SetPass(0);
|
||||||
Graphics.DrawMeshNow(SpineEditorUtilities.Icons.BoneMesh, Matrix4x4.TRS(vec, Quaternion.LookRotation(transform.forward, forward), Vector3.one * b.Data.Length * b.WorldScaleX));
|
Graphics.DrawMeshNow(SpineEditorUtilities.Icons.BoneMesh, transform.localToWorldMatrix * Matrix4x4.TRS(pos, rot, scale));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user