mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Minor cleanup.
This commit is contained in:
parent
953a98706f
commit
3b4286b8ef
@ -32,8 +32,12 @@ using UnityEditor;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Spine.Unity.Editor {
|
namespace Spine.Unity.Editor {
|
||||||
|
|
||||||
|
using Editor = UnityEditor.Editor;
|
||||||
|
using Event = UnityEngine.Event;
|
||||||
|
|
||||||
[CustomEditor(typeof(BoneFollower)), CanEditMultipleObjects]
|
[CustomEditor(typeof(BoneFollower)), CanEditMultipleObjects]
|
||||||
public class BoneFollowerInspector : UnityEditor.Editor {
|
public class BoneFollowerInspector : Editor {
|
||||||
SerializedProperty boneName, skeletonRenderer, followZPosition, followBoneRotation, followLocalScale, followSkeletonFlip;
|
SerializedProperty boneName, skeletonRenderer, followZPosition, followBoneRotation, followLocalScale, followSkeletonFlip;
|
||||||
BoneFollower targetBoneFollower;
|
BoneFollower targetBoneFollower;
|
||||||
bool needsReset;
|
bool needsReset;
|
||||||
@ -121,7 +125,7 @@ namespace Spine.Unity.Editor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needsReset && UnityEngine.Event.current.type == EventType.Layout) {
|
if (needsReset && Event.current.type == EventType.Layout) {
|
||||||
targetBoneFollower.Initialize();
|
targetBoneFollower.Initialize();
|
||||||
targetBoneFollower.LateUpdate();
|
targetBoneFollower.LateUpdate();
|
||||||
needsReset = false;
|
needsReset = false;
|
||||||
@ -171,7 +175,7 @@ namespace Spine.Unity.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var current = UnityEngine.Event.current;
|
var current = Event.current;
|
||||||
bool wasUndo = (current.type == EventType.ValidateCommand && current.commandName == "UndoRedoPerformed");
|
bool wasUndo = (current.type == EventType.ValidateCommand && current.commandName == "UndoRedoPerformed");
|
||||||
if (wasUndo)
|
if (wasUndo)
|
||||||
targetBoneFollower.Initialize();
|
targetBoneFollower.Initialize();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user