mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Fix SkeletonUtility Bone SceneGUI
This commit is contained in:
parent
f4d9a66d56
commit
6950832d1e
@ -96,21 +96,20 @@ public class SkeletonUtilityInspector : Editor {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDestroy () {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnSceneGUI () {
|
void OnSceneGUI () {
|
||||||
if (skeleton == null) {
|
if (skeleton == null) {
|
||||||
OnEnable();
|
OnEnable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
float flipRotation = skeleton.FlipX ? -1 : 1;
|
// 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 vec = transform.TransformPoint(new Vector3(b.WorldX, b.WorldY, 0));
|
||||||
|
|
||||||
|
// MITCH
|
||||||
Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX * flipRotation);
|
Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX * flipRotation);
|
||||||
Vector3 forward = transform.TransformDirection(rot * Vector3.right);
|
Vector3 forward = transform.TransformDirection(rot * Vector3.right);
|
||||||
forward *= flipRotation;
|
forward *= flipRotation;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user