mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Cleanup old renaming.
This commit is contained in:
parent
3554fece09
commit
62769c3e71
@ -258,12 +258,12 @@ namespace Spine.Unity.Editor {
|
|||||||
GameObject go = skeletonUtility.SpawnBoneRecursively(bone, utilityBone.transform, utilityBone.mode, utilityBone.position, utilityBone.rotation, utilityBone.scale);
|
GameObject go = skeletonUtility.SpawnBoneRecursively(bone, utilityBone.transform, utilityBone.mode, utilityBone.position, utilityBone.rotation, utilityBone.scale);
|
||||||
SkeletonUtilityBone[] newUtilityBones = go.GetComponentsInChildren<SkeletonUtilityBone>();
|
SkeletonUtilityBone[] newUtilityBones = go.GetComponentsInChildren<SkeletonUtilityBone>();
|
||||||
foreach (SkeletonUtilityBone utilBone in newUtilityBones)
|
foreach (SkeletonUtilityBone utilBone in newUtilityBones)
|
||||||
SkeletonGameObjectsInspector.AttachIcon(utilBone);
|
SkeletonUtilityInspector.AttachIcon(utilBone);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var bone = (Bone)obj;
|
var bone = (Bone)obj;
|
||||||
GameObject go = skeletonUtility.SpawnBone(bone, utilityBone.transform, utilityBone.mode, utilityBone.position, utilityBone.rotation, utilityBone.scale);
|
GameObject go = skeletonUtility.SpawnBone(bone, utilityBone.transform, utilityBone.mode, utilityBone.position, utilityBone.rotation, utilityBone.scale);
|
||||||
SkeletonGameObjectsInspector.AttachIcon(go.GetComponent<SkeletonUtilityBone>());
|
SkeletonUtilityInspector.AttachIcon(go.GetComponent<SkeletonUtilityBone>());
|
||||||
Selection.activeGameObject = go;
|
Selection.activeGameObject = go;
|
||||||
EditorGUIUtility.PingObject(go);
|
EditorGUIUtility.PingObject(go);
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ namespace Spine.Unity.Editor {
|
|||||||
void SpawnOverride () {
|
void SpawnOverride () {
|
||||||
GameObject go = skeletonUtility.SpawnBone(utilityBone.bone, utilityBone.transform.parent, SkeletonUtilityBone.Mode.Override, utilityBone.position, utilityBone.rotation, utilityBone.scale);
|
GameObject go = skeletonUtility.SpawnBone(utilityBone.bone, utilityBone.transform.parent, SkeletonUtilityBone.Mode.Override, utilityBone.position, utilityBone.rotation, utilityBone.scale);
|
||||||
go.name = go.name + " [Override]";
|
go.name = go.name + " [Override]";
|
||||||
SkeletonGameObjectsInspector.AttachIcon(go.GetComponent<SkeletonUtilityBone>());
|
SkeletonUtilityInspector.AttachIcon(go.GetComponent<SkeletonUtilityBone>());
|
||||||
Selection.activeGameObject = go;
|
Selection.activeGameObject = go;
|
||||||
EditorGUIUtility.PingObject(go);
|
EditorGUIUtility.PingObject(go);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,17 +41,17 @@ namespace Spine.Unity.Editor {
|
|||||||
using Icons = SpineEditorUtilities.Icons;
|
using Icons = SpineEditorUtilities.Icons;
|
||||||
|
|
||||||
[CustomEditor(typeof(SkeletonUtility))]
|
[CustomEditor(typeof(SkeletonUtility))]
|
||||||
public class SkeletonGameObjectsInspector : UnityEditor.Editor {
|
public class SkeletonUtilityInspector : UnityEditor.Editor {
|
||||||
|
|
||||||
SkeletonUtility skeletonGameObjects;
|
SkeletonUtility skeletonUtility;
|
||||||
Skeleton skeleton;
|
Skeleton skeleton;
|
||||||
SkeletonRenderer skeletonRenderer;
|
SkeletonRenderer skeletonRenderer;
|
||||||
bool isPrefab;
|
bool isPrefab;
|
||||||
readonly GUIContent SpawnHierarchyButtonLabel = new GUIContent("Spawn Hierarchy", Icons.skeleton);
|
readonly GUIContent SpawnHierarchyButtonLabel = new GUIContent("Spawn Hierarchy", Icons.skeleton);
|
||||||
|
|
||||||
void OnEnable () {
|
void OnEnable () {
|
||||||
skeletonGameObjects = (SkeletonUtility)target;
|
skeletonUtility = (SkeletonUtility)target;
|
||||||
skeletonRenderer = skeletonGameObjects.GetComponent<SkeletonRenderer>();
|
skeletonRenderer = skeletonUtility.GetComponent<SkeletonRenderer>();
|
||||||
skeleton = skeletonRenderer.Skeleton;
|
skeleton = skeletonRenderer.Skeleton;
|
||||||
|
|
||||||
if (skeleton == null) {
|
if (skeleton == null) {
|
||||||
@ -78,7 +78,7 @@ namespace Spine.Unity.Editor {
|
|||||||
|
|
||||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("boneRoot"), SpineInspectorUtility.TempContent("Skeleton Root"));
|
EditorGUILayout.PropertyField(serializedObject.FindProperty("boneRoot"), SpineInspectorUtility.TempContent("Skeleton Root"));
|
||||||
|
|
||||||
bool hasRootBone = skeletonGameObjects.boneRoot != null;
|
bool hasRootBone = skeletonUtility.boneRoot != null;
|
||||||
|
|
||||||
if (!hasRootBone)
|
if (!hasRootBone)
|
||||||
EditorGUILayout.HelpBox("No hierarchy found. Use Spawn Hierarchy to generate GameObjects for bones.", MessageType.Info);
|
EditorGUILayout.HelpBox("No hierarchy found. Use Spawn Hierarchy to generate GameObjects for bones.", MessageType.Info);
|
||||||
@ -90,9 +90,9 @@ namespace Spine.Unity.Editor {
|
|||||||
|
|
||||||
if (hasRootBone) {
|
if (hasRootBone) {
|
||||||
if (SpineInspectorUtility.CenteredButton(new GUIContent("Remove Hierarchy"))) {
|
if (SpineInspectorUtility.CenteredButton(new GUIContent("Remove Hierarchy"))) {
|
||||||
Undo.RegisterCompleteObjectUndo(skeletonGameObjects, "Remove Hierarchy");
|
Undo.RegisterCompleteObjectUndo(skeletonUtility, "Remove Hierarchy");
|
||||||
Undo.DestroyObjectImmediate(skeletonGameObjects.boneRoot.gameObject);
|
Undo.DestroyObjectImmediate(skeletonUtility.boneRoot.gameObject);
|
||||||
skeletonGameObjects.boneRoot = null;
|
skeletonUtility.boneRoot = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -134,23 +134,23 @@ namespace Spine.Unity.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SpawnFollowHierarchy () {
|
void SpawnFollowHierarchy () {
|
||||||
Selection.activeGameObject = skeletonGameObjects.SpawnHierarchy(SkeletonUtilityBone.Mode.Follow, true, true, true);
|
Selection.activeGameObject = skeletonUtility.SpawnHierarchy(SkeletonUtilityBone.Mode.Follow, true, true, true);
|
||||||
AttachIconsToChildren(skeletonGameObjects.boneRoot);
|
AttachIconsToChildren(skeletonUtility.boneRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpawnFollowHierarchyRootOnly () {
|
void SpawnFollowHierarchyRootOnly () {
|
||||||
Selection.activeGameObject = skeletonGameObjects.SpawnRoot(SkeletonUtilityBone.Mode.Follow, true, true, true);
|
Selection.activeGameObject = skeletonUtility.SpawnRoot(SkeletonUtilityBone.Mode.Follow, true, true, true);
|
||||||
AttachIconsToChildren(skeletonGameObjects.boneRoot);
|
AttachIconsToChildren(skeletonUtility.boneRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpawnOverrideHierarchy () {
|
void SpawnOverrideHierarchy () {
|
||||||
Selection.activeGameObject = skeletonGameObjects.SpawnHierarchy(SkeletonUtilityBone.Mode.Override, true, true, true);
|
Selection.activeGameObject = skeletonUtility.SpawnHierarchy(SkeletonUtilityBone.Mode.Override, true, true, true);
|
||||||
AttachIconsToChildren(skeletonGameObjects.boneRoot);
|
AttachIconsToChildren(skeletonUtility.boneRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpawnOverrideHierarchyRootOnly () {
|
void SpawnOverrideHierarchyRootOnly () {
|
||||||
Selection.activeGameObject = skeletonGameObjects.SpawnRoot(SkeletonUtilityBone.Mode.Override, true, true, true);
|
Selection.activeGameObject = skeletonUtility.SpawnRoot(SkeletonUtilityBone.Mode.Override, true, true, true);
|
||||||
AttachIconsToChildren(skeletonGameObjects.boneRoot);
|
AttachIconsToChildren(skeletonUtility.boneRoot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user