From 742ffe549786066c3bafdbfebb0e9cf798804f1c Mon Sep 17 00:00:00 2001 From: pharan Date: Tue, 16 May 2017 06:03:05 +0800 Subject: [PATCH] [unity] Make SkeletonDebug an EditorWindow. --- .../Editor/GUI/icon-constraintIK.png | Bin 0 -> 698 bytes .../Editor/GUI/icon-constraintIK.png.meta | 92 ++++++ .../Editor/GUI/icon-constraintPath.png | Bin 0 -> 639 bytes .../Editor/GUI/icon-constraintPath.png.meta | 92 ++++++ .../Editor/GUI/icon-constraintTransform.png | Bin 0 -> 613 bytes .../GUI/icon-constraintTransform.png.meta | 92 ++++++ .../Editor/GUI/icon-constraints.png | Bin 0 -> 741 bytes .../Editor/GUI/icon-constraints.png.meta | 92 ++++++ .../spine-unity/Editor/GUI/icon-skin.png | Bin 3430 -> 634 bytes .../spine-unity/Editor/GUI/icon-skin.png.meta | 57 +++- .../Editor/GUI/icon-skinPlaceholder.png | Bin 3370 -> 643 bytes .../spine-unity/Editor/GUI/icon-skinsRoot.png | Bin 790 -> 672 bytes .../Editor/SkeletonAnimationInspector.cs | 2 - .../Editor/SkeletonAnimatorInspector.cs | 3 - .../SkeletonDebugWindow.cs} | 280 +++++++++++++----- .../SkeletonDebugWindow.cs.meta} | 4 +- .../Editor/SkeletonRendererInspector.cs | 79 +++-- .../Editor/SpineEditorUtilities.cs | 10 + .../Editor/SpineInspectorUtility.cs | 14 +- .../spine-unity/Modules/SkeletonDebug.meta | 9 - .../Modules/SkeletonDebug/Editor.meta | 9 - .../Editor/SkeletonDebugEditor.cs.meta | 12 - .../Modules/SkeletonDebug/SkeletonDebug.cs | 6 - .../Editor/SkeletonUtilityInspector.cs | 11 +- 24 files changed, 696 insertions(+), 168 deletions(-) create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintIK.png create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintIK.png.meta create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintPath.png create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintPath.png.meta create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintTransform.png create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintTransform.png.meta create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/icon-constraints.png create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/icon-constraints.png.meta rename spine-unity/Assets/spine-unity/{Modules/SkeletonDebug/Editor/SkeletonDebugEditor.cs => Editor/SkeletonDebugWindow.cs} (50%) rename spine-unity/Assets/spine-unity/{Modules/SkeletonDebug/SkeletonDebug.cs.meta => Editor/SkeletonDebugWindow.cs.meta} (76%) delete mode 100644 spine-unity/Assets/spine-unity/Modules/SkeletonDebug.meta delete mode 100644 spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor.meta delete mode 100644 spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor/SkeletonDebugEditor.cs.meta delete mode 100644 spine-unity/Assets/spine-unity/Modules/SkeletonDebug/SkeletonDebug.cs diff --git a/spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintIK.png b/spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintIK.png new file mode 100644 index 0000000000000000000000000000000000000000..1c93d7546f5652a6c2289ac00c29babf35c30147 GIT binary patch literal 698 zcmV;r0!96aP)G1Y!FN6k#3*7171ZV6;nl*l*^~F=nPc5bFALnd4V`fan9?%lG}}#f$HQ5)uAq zjvf{&rH%u3KmlJxq_wBBpMg^92;k5(Z8(`s-tKfd?MNi@6!;_}oj=MVvS$H((P;GE z*4EZH5s^$LQ;f&s^T4UUyS4-Dof8uiGftlDZl6-B=THN{23#(e%MB5c zX0zEE8ylP7+}!+`&*xtO=KffP$;C!&dkltJqNBXFE1OdR%?4|YU)0q9R?U& zSXju3h~)G6cfc@kHk-}95fNEgSt$dTfMdIW9c>421{hggUHw=pmCBl?jRQTvKr9w} z*0o9`5-)*4D_}s^_3--o`iIHM$p?)_<8vSoxC8X>wVDVUi$TgSCb<;G>5^%wC zHs^}P;`=UOc6RoO6>zaqsZ~F#$A9l(b$1SW5Ojjn5rI>PL2|`$PA*}gmpVB$=@LQEB)FBR*x2^b zWZ>rDZGMAfrv<{RH_0#KwTtQ19tNH{QhV( zIua4lb^QZy8*u&ccOkd}YibTo(*?rL z>7OTvIK!4@+3|S%MKYOuI-O3B8;yqUcDo+~kAPj^>Y^a%6lj`Oo3HncVzKyYJRTpl z+wH@%ci`Tlzykz<$h=+ue6TKH)9?51W-^&K4nbH%P8VVslv3-!b>J3o2z(R~b7{f9 Z_yrmioohc_+s^<1002ovPDHLkV1glE6K4Pb literal 0 HcmV?d00001 diff --git a/spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintPath.png.meta b/spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintPath.png.meta new file mode 100644 index 000000000..4459669b3 --- /dev/null +++ b/spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintPath.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: c1aae98dd56b14c4b8c25360000b7e9e +timeCreated: 1494878353 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintTransform.png b/spine-unity/Assets/spine-unity/Editor/GUI/icon-constraintTransform.png new file mode 100644 index 0000000000000000000000000000000000000000..2264aaa56712714e0cac3a1c889abd92c87b3879 GIT binary patch literal 613 zcmV-r0-F7aP) z*B!^HjmP76A|kC;>p4(1uV>zI-vHbNoMyB6G>W2g5s}eobOP)Fh2MH(0JebJz=3Vs zZV&`-(==U*h(uBJ#c`Ztpkx;30YzZf_x(posk6*Ynx@M}qwxf|mM_i&cDmi}>o|^6 zG1Tw($G|P!ld^WY_BX&C$w?_SwQbwgJ@J)NA8NH)1GouX&I1n3;>BW-dY<$1i>5Ns~Jy{Zfd(iTm}OF1Sq8(!1~j>yvId; zf@NT&z(_%*n;=k1-k6mKHK4-l*6L3N_0EnaJ*=#0W^BQ*;mJ532NPTcrV9c9{ZJi| zOX2MK9d&LWSfp(eBL$Dgi1$3@EbtC6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+<$7ocYmPs(cDM(28Dyq{*m>M4?_iynUBkc4TkHU zI6gT!;y-fz>HMcd&t%Ugo)`Y2{>!cx7B7DI)$7;J(U{Spm-3gBzioV_{p!H$8L!*M z!p0uH$#^p{Ui4P`?ZJ24cOCDe-w#jZd?0@)|7iKK^;6KN`;!@ylm7$*nDhK&Gk-1H z0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F}0007!Nkl;vd-ksjZ>vOY14IEPt>puuOE@ z)=TmyS6vP+Ed%^YDYq+mD&X7e&s?@E+fx)bBg9M-+cXi&1j}OmxH0=K1(%cp{vq3g zy9V~Go42WQ>*B-K`RC~v5!wr<7#Tf3^*~3|lbV)>(sa-??skU`D-lVgn_jYZZsEz| z;7ueBj*ao6$??t0apBlBTz_lq%QI9~imrpE^Q3>^luId<228$Cx}wDB3yx%$Ym**WWTJkH}_#qEoSHcZPT z8V1J(C&t(7&GE6HEuYeLx?^_Rfe+1PK!*Y*b=GWr8W`ywhhx*yHGj}M$veXPTlj}v zZ~LP>Fr9<#y<2L!LU(~5DFBZeI^L|BnH3y4!uDio@pNpHWO}lll-iG>>dN;EvQtN#Y1sUxu!1ztM9P=t`VuB5eg^0Qq%gd8g-3NL_#v z8?s#25~*KU9V!AEMO?%jIt&pRB9IQuc~I=TFDC*b$Gp;3p4qu*qH8(e8D1+Qe~X7T zm{GGqJNvUji)=1X+W>FE<#4M1yrg%qQ6KPq_$wyxYXFzYY1Q-7fb;+W002ovPDHLk FV1h1Ocw7Jg diff --git a/spine-unity/Assets/spine-unity/Editor/GUI/icon-skin.png.meta b/spine-unity/Assets/spine-unity/Editor/GUI/icon-skin.png.meta index 364699a3f..f02b09c5f 100644 --- a/spine-unity/Assets/spine-unity/Editor/GUI/icon-skin.png.meta +++ b/spine-unity/Assets/spine-unity/Editor/GUI/icon-skin.png.meta @@ -1,13 +1,15 @@ fileFormatVersion: 2 guid: bfd9f3d2607e9e44c97384d7575a17dc +timeCreated: 1494878353 +licenseType: Free TextureImporter: fileIDToRecycleName: {} - serializedVersion: 2 + serializedVersion: 4 mipmaps: mipMapMode: 0 enableMipMap: 0 + sRGBTexture: 0 linearTexture: 1 - correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 @@ -15,14 +17,12 @@ TextureImporter: bumpmap: convertToNormalMap: 0 externalNormalMap: 0 - heightScale: .25 + heightScale: 0.25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 - generateCubemap: 0 + generateCubemap: 6 cubemapConvolution: 0 - cubemapConvolutionSteps: 8 - cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -3 maxTextureSize: 1024 @@ -33,20 +33,59 @@ TextureImporter: wrapMode: 1 nPOTScale: 0 lightmap: 0 - rGBM: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 - spritePivot: {x: .5, y: .5} + spritePivot: {x: 0.5, y: 0.5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 + alphaUsage: 1 alphaIsTransparency: 1 + spriteTessellationDetail: -1 textureType: 2 - buildTargetSettings: [] + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 spriteSheet: + serializedVersion: 2 sprites: [] + outline: [] spritePackingTag: userData: assetBundleName: diff --git a/spine-unity/Assets/spine-unity/Editor/GUI/icon-skinPlaceholder.png b/spine-unity/Assets/spine-unity/Editor/GUI/icon-skinPlaceholder.png index 3b11d379e43d42f770f6b3aaa58588f63774553b..17bfef06813ac3b36d4bc410de07c41f45b04ffb 100644 GIT binary patch delta 618 zcmV-w0+s!$8iNIpB!2{RLP=Bz2nYy#2xN!=000SaNLh0L01E2>01E2?f{P7W0000S zbVXQnQ*UN;cVTj606}DLVr3vkX>w(EZ*psMAVX6&=)AIw0005~NkljzWJ&P2rnU}luM@8 zq~AP$$DO=<$bZoT96Z)qdu#4?dkSb=%oUA29+~~RkIS%p8#w_ z=XQ@I@49pMPiz~k)UVzP)Bt5b37`Y4>y6q2&%8T_v-djW^RullfsKlxY?WzOy~+9b z^_PjR{$t=9^BRq@+Nf>HFDH|e8m})fG#O1)oO0E9}2LJ#707*qoM6N<$ Ef)FqlMgRZ+ delta 3367 zcmV+?4cPL71*#g5B!3BTNLh0L01FZT01FZU(%pXi000V4X+uL$P-t&-Z*ypGa3D!T zLm+T+Z)Rz1WdHzp+MQEpR8#2|J@?-9LQ9B%luK_?6$l_wLW_VDktQl32@pz%A)(n7 zQNa;KMFbnjpojyGj)066Q7jCK3fKqaA)=0hqlk*i`{8?|Yk$_f_vX$1wbwr9tn;0- z&j-K=43f59&ghTmgWD0l;*TI7}*0BAb^tj|`8MF3bZ02F3R#5n-i zEdVe{S7t~6u(trf&JYW-00;~KFj0twDF6g}0AR=?BX|IWnE(_<@>e|ZE3OddDgXd@ znX){&BsoQaTL>+22Uk}v9w^R97b_GtVFF>AKrX_0nSU8Ffiw@`^UMGMppg|3;Dhu1 zc+L*4&dxTDwhmt{>c0m6B4T3W{^ifBa6kY6;dFk{{wy!E8h|?nfNlPwCGG@hUJIag z_lst-4?wj5py}FI^KkfnJUm6Akh$5}<>chpO2k52Vaiv1{%68pz*qfj`F=e7_x0eu z;v|7GU4MZ`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cPNQJ#S_@)6z~mw53g{>>P)aRlK7ZGOoOrzYWOgWcVSKk%EbP{HfBvrRZ0Nea_Hk-?2|)P- z$5}x(n;khEvu8r?V5-)r!*YB!|M|7D@-R0_Dcy1kFwToC%l!V~e(H~*8UicSJ9)|I z?ug;->bpuMUx@(l;2)f5A)QX|U7x%G00K)`h%OO9cPHvf&DX5>zkdQwSk!`MYS2s# zMO|q=pCN?kaG1*3`I|vC1wsrl6t!R6zQzv|5B!EuyNL2zv?gE*{~FW9@uxFn{eL01)*P1O|q{b%>{8 zrmExslsO#Dvn2$UtdzEYys6tH>5{sVycF&acs+4bRdQQPFYf}-H~{M6m&1Dz9~q5` zBpLOS{w^OA-_dDq`jhzpm{xGKfo=c-j@G{dK%D%PDHLkV1lO2NT2`! diff --git a/spine-unity/Assets/spine-unity/Editor/SkeletonAnimationInspector.cs b/spine-unity/Assets/spine-unity/Editor/SkeletonAnimationInspector.cs index fddfadfb8..0dd5f6a94 100644 --- a/spine-unity/Assets/spine-unity/Editor/SkeletonAnimationInspector.cs +++ b/spine-unity/Assets/spine-unity/Editor/SkeletonAnimationInspector.cs @@ -95,8 +95,6 @@ namespace Spine.Unity.Editor { SceneView.RepaintAll(); requireRepaint = false; } - - DrawSkeletonUtilityButton(multi); } } diff --git a/spine-unity/Assets/spine-unity/Editor/SkeletonAnimatorInspector.cs b/spine-unity/Assets/spine-unity/Editor/SkeletonAnimatorInspector.cs index 42a618c6f..5ea5b3278 100644 --- a/spine-unity/Assets/spine-unity/Editor/SkeletonAnimatorInspector.cs +++ b/spine-unity/Assets/spine-unity/Editor/SkeletonAnimatorInspector.cs @@ -49,9 +49,6 @@ namespace Spine.Unity.Editor { base.DrawInspectorGUI(multi); EditorGUILayout.PropertyField(autoReset); EditorGUILayout.PropertyField(layerMixModes, true); - if (!TargetIsValid) return; - if (!isInspectingPrefab) - DrawSkeletonUtilityButton(multi); } } } diff --git a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor/SkeletonDebugEditor.cs b/spine-unity/Assets/spine-unity/Editor/SkeletonDebugWindow.cs similarity index 50% rename from spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor/SkeletonDebugEditor.cs rename to spine-unity/Assets/spine-unity/Editor/SkeletonDebugWindow.cs index c585cb58b..169933e93 100644 --- a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor/SkeletonDebugEditor.cs +++ b/spine-unity/Assets/spine-unity/Editor/SkeletonDebugWindow.cs @@ -33,49 +33,85 @@ using System.Collections.Generic; using UnityEngine; using UnityEditor; -using Spine.Unity.Modules; using UnityEditor.AnimatedValues; namespace Spine.Unity.Editor { using Editor = UnityEditor.Editor; using Icons = SpineEditorUtilities.Icons; - [CustomEditor(typeof(SkeletonDebug))] - public class SkeletonDebugEditor : Editor { + public class SkeletonDebugWindow : EditorWindow { + + const bool IsUtilityWindow = true; + + [MenuItem("CONTEXT/SkeletonRenderer/Open Skeleton Debug Window", false, 5000)] + public static void Init () { + var window = EditorWindow.GetWindow(IsUtilityWindow); + window.minSize = new Vector2(330f, 360f); + window.maxSize = new Vector2(600f, 4000f); + window.titleContent = new GUIContent("Skeleton Debug", Icons.spine); + window.Show(); + window.OnSelectionChange(); + } + - static AnimBool showSlotsTree = new AnimBool(false); static AnimBool showSkeleton = new AnimBool(true); + static AnimBool showSlotsTree = new AnimBool(false); static AnimBool showConstraintsTree = new AnimBool(false); + static AnimBool showDrawOrderTree = new AnimBool(false); + static AnimBool showEventDataTree = new AnimBool(false); + static AnimBool showInspectBoneTree = new AnimBool(false); - protected static bool showBoneNames, showPaths = true, showShapes = true, showConstraints = true; + Vector2 scrollPos; GUIContent SlotsRootLabel, SkeletonRootLabel; GUIStyle BoldFoldoutStyle; - SkeletonDebug skeletonDebug; - SkeletonRenderer skeletonRenderer; + public SkeletonRenderer skeletonRenderer; Skeleton skeleton; - Skin activeSkin; - bool isPrefab; + SerializedProperty bpo; + Bone bone; + + [SpineBone(dataField:"skeletonRenderer")] + public string boneName; + readonly Dictionary> attachmentTable = new Dictionary>(); - #region Menus - [MenuItem("CONTEXT/SkeletonRenderer/Debug with SkeletonDebug", false, 5000)] - static void AddSkeletonDebug (MenuCommand command) { - var go = ((SkeletonRenderer)command.context).gameObject; - go.AddComponent(); - Undo.RegisterCreatedObjectUndo(go, "Add SkeletonDebug"); - } - #endregion + void OnSelectionChange () { + bool noSkeletonRenderer = false; - void OnEnable () { - Initialize(); + var selectedObject = Selection.activeGameObject; + if (selectedObject == null) { + noSkeletonRenderer = true; + } else { + var selectedSkeletonRenderer = selectedObject.GetComponent(); + if (selectedSkeletonRenderer == null) { + noSkeletonRenderer = true; + } else if (skeletonRenderer != selectedSkeletonRenderer) { + skeletonRenderer = selectedSkeletonRenderer; + skeletonRenderer.Initialize(false); + skeletonRenderer.LateUpdate(); + skeleton = skeletonRenderer.skeleton; + isPrefab |= PrefabUtility.GetPrefabType(selectedObject) == PrefabType.Prefab; + UpdateAttachments(); + } + } + + if (noSkeletonRenderer) { + skeletonRenderer = null; + skeleton = null; + attachmentTable.Clear(); + isPrefab = false; + boneName = string.Empty; + bone = null; + } + + Repaint(); } - void Initialize () { + void OnGUI () { if (SlotsRootLabel == null) { SlotsRootLabel = new GUIContent("Slots", Icons.slotRoot); SkeletonRootLabel = new GUIContent("Skeleton", Icons.skeleton); @@ -85,39 +121,13 @@ namespace Spine.Unity.Editor { BoldFoldoutStyle.fixedWidth = 0; } - if (skeleton == null) { - skeletonDebug = (SkeletonDebug)target; - skeletonRenderer = skeletonDebug.GetComponent(); - skeletonRenderer.Initialize(false); - skeletonRenderer.LateUpdate(); - skeleton = skeletonRenderer.skeleton; - } - - if (attachmentTable.Count == 0) UpdateAttachments(); - - if (!skeletonRenderer.valid) return; - isPrefab |= PrefabUtility.GetPrefabType(this.target) == PrefabType.Prefab; - } - - public void OnSceneGUI () { - var transform = skeletonRenderer.transform; - if (skeleton == null) return; - if (isPrefab) return; - - if (showPaths) SpineHandles.DrawPaths(transform, skeleton); - if (showConstraints) SpineHandles.DrawConstraints(transform, skeleton); - if (showBoneNames) SpineHandles.DrawBoneNames(transform, skeleton); - if (showShapes) SpineHandles.DrawBoundingBoxes(transform, skeleton); - } - - public override void OnInspectorGUI () { - Initialize(); - bool requireRepaint = false; + EditorGUILayout.Space(); + EditorGUI.BeginDisabledGroup(true); + EditorGUILayout.ObjectField("Debug Selection", skeletonRenderer, typeof(SkeletonRenderer), true); + EditorGUI.EndDisabledGroup(); - if (skeletonRenderer.skeleton != skeleton || activeSkin != skeleton.Skin) { - UpdateAttachments(); - } + if (skeleton == null || skeletonRenderer == null || !skeletonRenderer.valid) return; if (isPrefab) { GUILayout.Label(new GUIContent("Cannot edit Prefabs", Icons.warning)); @@ -129,37 +139,96 @@ namespace Spine.Unity.Editor { return; } - EditorGUILayout.HelpBox("This is a debug component. Changes are not serialized.", MessageType.Info); + if (activeSkin != skeleton.Skin) + UpdateAttachments(); + + scrollPos = EditorGUILayout.BeginScrollView(scrollPos); + + using (new SpineInspectorUtility.BoxScope(false)) { + if (SpineInspectorUtility.CenteredButton(new GUIContent("Skeleton.SetToSetupPose()"))) { + skeleton.SetToSetupPose(); + requireRepaint = true; + } + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.LabelField("Scene View", EditorStyles.boldLabel); + using (new SpineInspectorUtility.LabelWidthScope()) { + SkeletonRendererInspector.showBoneNames = EditorGUILayout.Toggle("Show Bone Names", SkeletonRendererInspector.showBoneNames); + SkeletonRendererInspector.showPaths = EditorGUILayout.Toggle("Show Paths", SkeletonRendererInspector.showPaths); + SkeletonRendererInspector.showShapes = EditorGUILayout.Toggle("Show Shapes", SkeletonRendererInspector.showShapes); + SkeletonRendererInspector.showConstraints = EditorGUILayout.Toggle("Show Constraints", SkeletonRendererInspector.showConstraints); + } + requireRepaint |= EditorGUI.EndChangeCheck(); - using (new SpineInspectorUtility.BoxScope()) { // Skeleton showSkeleton.target = EditorGUILayout.Foldout(showSkeleton.target, SkeletonRootLabel, BoldFoldoutStyle); if (showSkeleton.faded > 0) { - using (new EditorGUILayout.FadeGroupScope(showSkeleton.faded)) { - using (new SpineInspectorUtility.IndentScope()) { + using (new SpineInspectorUtility.IndentScope()) { + using (new EditorGUILayout.FadeGroupScope(showSkeleton.faded)) { EditorGUI.BeginChangeCheck(); - skeleton.SetColor(EditorGUILayout.ColorField(".R .G .B .A", skeleton.GetColor())); - skeleton.FlipX = EditorGUILayout.ToggleLeft(".FlipX", skeleton.FlipX); - skeleton.FlipY = EditorGUILayout.ToggleLeft(".FlipY", skeleton.FlipY); - EditorGUILayout.Space(); - using (new SpineInspectorUtility.LabelWidthScope()) { - showBoneNames = EditorGUILayout.Toggle("Show Bone Names", showBoneNames); - showPaths = EditorGUILayout.Toggle("Show Paths", showPaths); - showShapes = EditorGUILayout.Toggle("Show Shapes", showShapes); - showConstraints = EditorGUILayout.Toggle("Show Constraints", showConstraints); - } + // Flip + EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(160f)); + EditorGUILayout.LabelField("Flip", GUILayout.MaxWidth(EditorGUIUtility.labelWidth - 20f)); + skeleton.FlipX = EditorGUILayout.ToggleLeft(".FlipX", skeleton.FlipX, GUILayout.MaxWidth(70f)); + skeleton.FlipY = EditorGUILayout.ToggleLeft(".FlipY", skeleton.FlipY, GUILayout.MaxWidth(70f)); + GUILayout.EndHorizontal(); + + // Color + skeleton.SetColor(EditorGUILayout.ColorField(".R .G .B .A", skeleton.GetColor())); + requireRepaint |= EditorGUI.EndChangeCheck(); } } } + // Bone + showInspectBoneTree.target = EditorGUILayout.Foldout(showInspectBoneTree.target, new GUIContent("Bone", Icons.bone), BoldFoldoutStyle); + if (showInspectBoneTree.faded > 0) { + using (new SpineInspectorUtility.IndentScope()) { + using (new EditorGUILayout.FadeGroupScope(showInspectBoneTree.faded)) { + if (bpo == null) bpo = new SerializedObject(this).FindProperty("boneName"); + EditorGUILayout.PropertyField(bpo); + if (!string.IsNullOrEmpty(bpo.stringValue)) { + if (bone == null || bone.Data.Name != bpo.stringValue) { + bone = skeleton.FindBone(bpo.stringValue); + } + + if (bone != null) { + using (new EditorGUI.DisabledGroupScope(true)) { + var boneParent = bone.Parent; + if (boneParent != null) EditorGUILayout.TextField("parent", boneParent.Data.Name); + EditorGUILayout.Space(); + + EditorGUILayout.Slider("Local Rotation", bone.Rotation, -180f, 180f); + EditorGUILayout.Vector2Field("Local Position", new Vector2(bone.X, bone.Y)); + EditorGUILayout.Vector2Field("Local Scale", new Vector2(bone.ScaleX, bone.ScaleY)); + EditorGUILayout.Vector2Field("Local Shear", new Vector2(bone.ShearX, bone.ShearY)); +// EditorGUILayout.Space(); +// EditorGUILayout.LabelField("LocalToWorld Matrix"); +// EditorGUILayout.Vector2Field("AB", new Vector2(bone.A, bone.B)); +// EditorGUILayout.Vector2Field("CD", new Vector2(bone.C, bone.D)); + } + } + requireRepaint = true; + } else { + bone = null; + } + } + } + } + // Slots int preSlotsIndent = EditorGUI.indentLevel; showSlotsTree.target = EditorGUILayout.Foldout(showSlotsTree.target, SlotsRootLabel, BoldFoldoutStyle); if (showSlotsTree.faded > 0) { using (new EditorGUILayout.FadeGroupScope(showSlotsTree.faded)) { + if (SpineInspectorUtility.CenteredButton(new GUIContent("Skeleton.SetSlotsToSetupPose()"))) { + skeleton.SetSlotsToSetupPose(); + requireRepaint = true; + } + int baseIndent = EditorGUI.indentLevel; foreach (KeyValuePair> pair in attachmentTable) { Slot slot = pair.Key; @@ -194,22 +263,22 @@ namespace Spine.Unity.Editor { // Constraints const string NoneText = ""; - showConstraintsTree.target = EditorGUILayout.Foldout(showConstraintsTree.target, "Constraints", BoldFoldoutStyle); + showConstraintsTree.target = EditorGUILayout.Foldout(showConstraintsTree.target, new GUIContent("Constraints", Icons.constraintRoot), BoldFoldoutStyle); if (showConstraintsTree.faded > 0) { - using (new EditorGUILayout.FadeGroupScope(showConstraintsTree.faded)) { - using (new SpineInspectorUtility.IndentScope()) { + using (new SpineInspectorUtility.IndentScope()) { + using (new EditorGUILayout.FadeGroupScope(showConstraintsTree.faded)) { const float MixMin = 0f; const float MixMax = 1f; - EditorGUILayout.LabelField(string.Format("IK Constraints ({0})", skeleton.IkConstraints.Count), EditorStyles.boldLabel); + EditorGUILayout.LabelField(new GUIContent(string.Format("IK Constraints ({0})", skeleton.IkConstraints.Count), Icons.constraintIK), EditorStyles.boldLabel); using (new SpineInspectorUtility.IndentScope()) { if (skeleton.IkConstraints.Count > 0) { foreach (var c in skeleton.IkConstraints) { - EditorGUILayout.LabelField(c.Data.Name); + EditorGUILayout.LabelField(new GUIContent(c.Data.Name, Icons.constraintIK)); EditorGUI.BeginChangeCheck(); - c.BendDirection = EditorGUILayout.Toggle("Bend Direction Positive", c.BendDirection > 0) ? 1 : -1; c.Mix = EditorGUILayout.Slider("Mix", c.Mix, MixMin, MixMax); + c.BendDirection = EditorGUILayout.Toggle("Bend Direction +", c.BendDirection > 0) ? 1 : -1; if (EditorGUI.EndChangeCheck()) requireRepaint = true; EditorGUILayout.Space(); @@ -220,11 +289,11 @@ namespace Spine.Unity.Editor { } } - EditorGUILayout.LabelField(string.Format("Transform Constraints ({0})", skeleton.TransformConstraints.Count), EditorStyles.boldLabel); + EditorGUILayout.LabelField(new GUIContent(string.Format("Transform Constraints ({0})", skeleton.TransformConstraints.Count), Icons.constraintTransform), EditorStyles.boldLabel); using (new SpineInspectorUtility.IndentScope()) { if (skeleton.TransformConstraints.Count > 0) { foreach (var c in skeleton.TransformConstraints) { - EditorGUILayout.LabelField(c.Data.Name); + EditorGUILayout.LabelField(new GUIContent(c.Data.Name, Icons.constraintTransform)); EditorGUI.BeginChangeCheck(); c.TranslateMix = EditorGUILayout.Slider("TranslateMix", c.TranslateMix, MixMin, MixMax); @@ -240,11 +309,11 @@ namespace Spine.Unity.Editor { } } - EditorGUILayout.LabelField(string.Format("Path Constraints ({0})", skeleton.PathConstraints.Count), EditorStyles.boldLabel); + EditorGUILayout.LabelField(new GUIContent(string.Format("Path Constraints ({0})", skeleton.PathConstraints.Count), Icons.constraintPath), EditorStyles.boldLabel); using (new SpineInspectorUtility.IndentScope()) { if (skeleton.PathConstraints.Count > 0) { foreach (var c in skeleton.PathConstraints) { - EditorGUILayout.LabelField(c.Data.Name); + EditorGUILayout.LabelField(new GUIContent(c.Data.Name, Icons.constraintPath)); EditorGUILayout.LabelField("PositionMode." + c.Data.PositionMode); EditorGUILayout.LabelField("SpacingMode." + c.Data.SpacingMode); EditorGUILayout.LabelField("RotateMode." + c.Data.RotateMode); @@ -267,19 +336,69 @@ namespace Spine.Unity.Editor { } } - if (showSlotsTree.isAnimating || showSkeleton.isAnimating || showConstraintsTree.isAnimating) + showDrawOrderTree.target = EditorGUILayout.Foldout(showDrawOrderTree.target, new GUIContent("Draw Order and Separators", Icons.slotRoot), BoldFoldoutStyle); + if (showDrawOrderTree.faded > 0) { + using (new SpineInspectorUtility.IndentScope()) { + using (new EditorGUILayout.FadeGroupScope(showDrawOrderTree.faded)) { + + if (Application.isPlaying) { + foreach (var slot in skeleton.DrawOrder) { + if (skeletonRenderer.separatorSlots.Contains(slot)) EditorGUILayout.LabelField("------"); + EditorGUILayout.LabelField(new GUIContent(slot.Data.Name, Icons.slot), GUILayout.ExpandWidth(false)); + } + } else { + foreach (var slot in skeleton.DrawOrder) { + var slotNames = skeletonRenderer.separatorSlotNames; + for (int i = 0, n = slotNames.Length; i < n; i++) { + if (string.Equals(slotNames[i], slot.Data.Name, System.StringComparison.Ordinal)) { + EditorGUILayout.LabelField("------"); + break; + } + } + EditorGUILayout.LabelField(new GUIContent(slot.Data.Name, Icons.slot), GUILayout.ExpandWidth(false)); + } + } + + } + } + } + + showEventDataTree.target = EditorGUILayout.Foldout(showEventDataTree.target, new GUIContent("Events", Icons.userEvent), BoldFoldoutStyle); + if (showEventDataTree.faded > 0) { + using (new SpineInspectorUtility.IndentScope()) { + using (new EditorGUILayout.FadeGroupScope(showEventDataTree.faded)) { + if (skeleton.Data.Events.Count > 0) { + foreach (var e in skeleton.Data.Events) { + EditorGUILayout.LabelField(new GUIContent(e.Name, Icons.userEvent)); + } + } else { + EditorGUILayout.LabelField(NoneText); + } + } + } + } + + if (IsAnimating(showSlotsTree, showSkeleton, showConstraintsTree, showDrawOrderTree, showEventDataTree, showInspectBoneTree)) Repaint(); } if (requireRepaint) { skeletonRenderer.LateUpdate(); + Repaint(); SceneView.RepaintAll(); } + + EditorGUILayout.EndScrollView(); } - - + + static bool IsAnimating (params AnimBool[] animBools) { + foreach (var a in animBools) + if (a.isAnimating) return true; + return false; + } + void UpdateAttachments () { - skeleton = skeletonRenderer.skeleton; + //skeleton = skeletonRenderer.skeleton; Skin defaultSkin = skeleton.Data.DefaultSkin; Skin skin = skeleton.Skin ?? defaultSkin; bool notDefaultSkin = skin != defaultSkin; @@ -294,8 +413,5 @@ namespace Spine.Unity.Editor { activeSkin = skeleton.Skin; } - - - } } diff --git a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/SkeletonDebug.cs.meta b/spine-unity/Assets/spine-unity/Editor/SkeletonDebugWindow.cs.meta similarity index 76% rename from spine-unity/Assets/spine-unity/Modules/SkeletonDebug/SkeletonDebug.cs.meta rename to spine-unity/Assets/spine-unity/Editor/SkeletonDebugWindow.cs.meta index 62be74472..d3697a050 100644 --- a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/SkeletonDebug.cs.meta +++ b/spine-unity/Assets/spine-unity/Editor/SkeletonDebugWindow.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 7b337e07bc016684dabf04793dd00ea3 -timeCreated: 1494814889 +guid: 7093e73ff3cf6c543ac5865980070b49 +timeCreated: 1494837950 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/spine-unity/Assets/spine-unity/Editor/SkeletonRendererInspector.cs b/spine-unity/Assets/spine-unity/Editor/SkeletonRendererInspector.cs index aa4f540f0..8ebb49769 100644 --- a/spine-unity/Assets/spine-unity/Editor/SkeletonRendererInspector.cs +++ b/spine-unity/Assets/spine-unity/Editor/SkeletonRendererInspector.cs @@ -36,11 +36,13 @@ using UnityEngine; namespace Spine.Unity.Editor { using Event = UnityEngine.Event; + using Icons = SpineEditorUtilities.Icons; [CustomEditor(typeof(SkeletonRenderer))] [CanEditMultipleObjects] public class SkeletonRendererInspector : UnityEditor.Editor { protected static bool advancedFoldout; + internal static bool showBoneNames, showPaths, showShapes, showConstraints = true; protected SerializedProperty skeletonDataAsset, initialSkinName; protected SerializedProperty initialFlipX, initialFlipY; @@ -76,8 +78,8 @@ namespace Spine.Unity.Editor { SpineEditorUtilities.ConfirmInitialization(); // Labels - SkeletonDataAssetLabel = new GUIContent("SkeletonData Asset", SpineEditorUtilities.Icons.spine); - SkeletonUtilityButtonContent = new GUIContent("Add Skeleton Utility", SpineEditorUtilities.Icons.skeletonUtility); + SkeletonDataAssetLabel = new GUIContent("SkeletonData Asset", Icons.spine); + SkeletonUtilityButtonContent = new GUIContent("Add Skeleton Utility", Icons.skeletonUtility); MeshesLabel = new GUIContent("Render MeshAttachments", "Disable to optimize rendering for skeletons that don't use Mesh Attachments"); ImmubleTrianglesLabel = new GUIContent("Immutable Triangles", "Enable to optimize rendering for skeletons that never change attachment visbility"); PMAVertexColorsLabel = new GUIContent("PMA Vertex Colors", "Use this if you are using the default Spine/Skeleton shader or any premultiply-alpha shader."); @@ -93,7 +95,7 @@ namespace Spine.Unity.Editor { initialSkinName = so.FindProperty("initialSkinName"); initialFlipX = so.FindProperty("initialFlipX"); initialFlipY = so.FindProperty("initialFlipY"); - normals = so.FindProperty("calculateNormals"); + normals = so.FindProperty("addNormals"); tangents = so.FindProperty("calculateTangents"); meshes = so.FindProperty("renderMeshes"); immutableTriangles = so.FindProperty("immutableTriangles"); @@ -238,7 +240,20 @@ namespace Spine.Unity.Editor { // More Render Options... using (new SpineInspectorUtility.BoxScope()) { EditorGUI.BeginChangeCheck(); - if (advancedFoldout = EditorGUILayout.Foldout(advancedFoldout, "Advanced")) { + + EditorGUILayout.BeginHorizontal(GUILayout.Height(EditorGUIUtility.singleLineHeight + 5)); + advancedFoldout = EditorGUILayout.Foldout(advancedFoldout, "Advanced"); + if (advancedFoldout) { + EditorGUILayout.Space(); + if (GUILayout.Button("Debug", EditorStyles.miniButton, GUILayout.Width(65f))) + SkeletonDebugWindow.Init(); + } else { + EditorGUILayout.Space(); + } + EditorGUILayout.EndHorizontal(); + + if (advancedFoldout) { + using (new SpineInspectorUtility.IndentScope()) { using (new EditorGUILayout.HorizontalScope()) { initialFlipX.boolValue = EditorGUILayout.ToggleLeft(initialFlipX.displayName, initialFlipX.boolValue, GUILayout.Width(120f)); @@ -247,7 +262,7 @@ namespace Spine.Unity.Editor { } EditorGUILayout.Space(); - + EditorGUILayout.LabelField("Renderer Settings", EditorStyles.boldLabel); using (new SpineInspectorUtility.LabelWidthScope()) { // Optimization options if (singleSubmesh != null) EditorGUILayout.PropertyField(singleSubmesh, SingleSubmeshLabel); @@ -277,8 +292,30 @@ namespace Spine.Unity.Editor { } EditorGUILayout.Space(); + + if (TargetIsValid && !isInspectingPrefab) { + if (multi) { + // Support multi-edit SkeletonUtility button. + // EditorGUILayout.Space(); + // bool addSkeletonUtility = GUILayout.Button(buttonContent, GUILayout.Height(30)); + // foreach (var t in targets) { + // var component = t as Component; + // if (addSkeletonUtility && component.GetComponent() == null) + // component.gameObject.AddComponent(); + // } + } else { + var component = (Component)target; + if (component.GetComponent() == null) { + if (SpineInspectorUtility.CenteredButton(SkeletonUtilityButtonContent, 21, true, 200f)) + component.gameObject.AddComponent(); + } + } + } + + EditorGUILayout.Space(); } } + if (EditorGUI.EndChangeCheck()) SceneView.RepaintAll(); } @@ -308,6 +345,13 @@ namespace Spine.Unity.Editor { const string SeparatorsDescription = "Stored names of slots where the Skeleton's render will be split into different batches. This is used by separate components that split the render into different MeshRenderers or GameObjects."; if (separatorSlotNames.isExpanded) { EditorGUILayout.PropertyField(separatorSlotNames, new GUIContent(separatorSlotNames.displayName + terminalSlotWarning, SeparatorsDescription), true); + GUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + if (GUILayout.Button("+", GUILayout.MaxWidth(28f), GUILayout.MaxHeight(15f))) { + separatorSlotNames.arraySize++; + } + GUILayout.EndHorizontal(); + EditorGUILayout.Space(); } else EditorGUILayout.PropertyField(separatorSlotNames, new GUIContent(separatorSlotNames.displayName + string.Format("{0} [{1}]", terminalSlotWarning, separatorSlotNames.arraySize), SeparatorsDescription), true); @@ -318,30 +362,13 @@ namespace Spine.Unity.Editor { var skeletonRenderer = (SkeletonRenderer)target; var skeleton = skeletonRenderer.skeleton; var transform = skeletonRenderer.transform; - if (skeleton == null) return; + if (showPaths) SpineHandles.DrawPaths(transform, skeleton); SpineHandles.DrawBones(transform, skeleton); - } - - public void DrawSkeletonUtilityButton (bool multi) { - if (multi) { - // Support multi-edit SkeletonUtility button. - // EditorGUILayout.Space(); - // bool addSkeletonUtility = GUILayout.Button(buttonContent, GUILayout.Height(30)); - // foreach (var t in targets) { - // var component = t as Component; - // if (addSkeletonUtility && component.GetComponent() == null) - // component.gameObject.AddComponent(); - // } - } else { - EditorGUILayout.Space(); - var component = (Component)target; - if (component.GetComponent() == null) { - if (SpineInspectorUtility.CenteredButton(SkeletonUtilityButtonContent, 21)) - component.gameObject.AddComponent(); - } - } + if (showConstraints) SpineHandles.DrawConstraints(transform, skeleton); + if (showBoneNames) SpineHandles.DrawBoneNames(transform, skeleton); + if (showShapes) SpineHandles.DrawBoundingBoxes(transform, skeleton); } override public void OnInspectorGUI () { diff --git a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs index 994ae4d6d..cc6ed2878 100644 --- a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs +++ b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs @@ -70,6 +70,10 @@ namespace Spine.Unity.Editor { public static Texture2D spine; public static Texture2D userEvent; public static Texture2D constraintNib; + public static Texture2D constraintRoot; + public static Texture2D constraintTransform; + public static Texture2D constraintPath; + public static Texture2D constraintIK; public static Texture2D warning; public static Texture2D skeletonUtility; public static Texture2D hingeChain; @@ -97,6 +101,12 @@ namespace Spine.Unity.Editor { spine = (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/icon-spine.png"); userEvent = (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/icon-event.png"); constraintNib = (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/icon-constraintNib.png"); + + constraintRoot = (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/icon-constraints.png"); + constraintTransform = (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/icon-constraintTransform.png"); + constraintPath = (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/icon-constraintPath.png"); + constraintIK = (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/icon-constraintIK.png"); + warning = (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/icon-warning.png"); skeletonUtility = (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/icon-skeletonUtility.png"); hingeChain = (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/icon-hingeChain.png"); diff --git a/spine-unity/Assets/spine-unity/Editor/SpineInspectorUtility.cs b/spine-unity/Assets/spine-unity/Editor/SpineInspectorUtility.cs index 427cff43f..58fb47aaf 100644 --- a/spine-unity/Assets/spine-unity/Editor/SpineInspectorUtility.cs +++ b/spine-unity/Assets/spine-unity/Editor/SpineInspectorUtility.cs @@ -140,12 +140,12 @@ namespace Spine.Unity.Editor { } } - public static bool LargeCenteredButton (string label, bool sideSpace = true) { + public static bool LargeCenteredButton (string label, bool sideSpace = true, float maxWidth = CenterButtonMaxWidth) { if (sideSpace) { bool clicked; using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.Space(); - clicked = GUILayout.Button(label, SpineButtonStyle, GUILayout.MaxWidth(CenterButtonMaxWidth), GUILayout.Height(CenterButtonHeight)); + clicked = GUILayout.Button(label, SpineButtonStyle, GUILayout.MaxWidth(maxWidth), GUILayout.Height(CenterButtonHeight)); EditorGUILayout.Space(); } EditorGUILayout.Space(); @@ -155,12 +155,12 @@ namespace Spine.Unity.Editor { } } - public static bool LargeCenteredButton (GUIContent content, bool sideSpace = true) { + public static bool LargeCenteredButton (GUIContent content, bool sideSpace = true, float maxWidth = CenterButtonMaxWidth) { if (sideSpace) { bool clicked; using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.Space(); - clicked = GUILayout.Button(content, SpineButtonStyle, GUILayout.MaxWidth(CenterButtonMaxWidth), GUILayout.Height(CenterButtonHeight)); + clicked = GUILayout.Button(content, SpineButtonStyle, GUILayout.MaxWidth(maxWidth), GUILayout.Height(CenterButtonHeight)); EditorGUILayout.Space(); } EditorGUILayout.Space(); @@ -170,18 +170,18 @@ namespace Spine.Unity.Editor { } } - public static bool CenteredButton (GUIContent content, float height = 20f, bool sideSpace = true) { + public static bool CenteredButton (GUIContent content, float height = 20f, bool sideSpace = true, float maxWidth = CenterButtonMaxWidth) { if (sideSpace) { bool clicked; using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.Space(); - clicked = GUILayout.Button(content, GUILayout.MaxWidth(CenterButtonMaxWidth), GUILayout.Height(height)); + clicked = GUILayout.Button(content, GUILayout.MaxWidth(maxWidth), GUILayout.Height(height)); EditorGUILayout.Space(); } EditorGUILayout.Space(); return clicked; } else { - return GUILayout.Button(content, GUILayout.MaxWidth(CenterButtonMaxWidth), GUILayout.Height(height)); + return GUILayout.Button(content, GUILayout.MaxWidth(maxWidth), GUILayout.Height(height)); } } #endregion diff --git a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug.meta b/spine-unity/Assets/spine-unity/Modules/SkeletonDebug.meta deleted file mode 100644 index 348515c56..000000000 --- a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 061893380931ebd4f94376c54cdb60dc -folderAsset: yes -timeCreated: 1494814883 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor.meta b/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor.meta deleted file mode 100644 index ae2668b10..000000000 --- a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 7e09f6de2e1bcbf4085ca3825dc89489 -folderAsset: yes -timeCreated: 1494814895 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor/SkeletonDebugEditor.cs.meta b/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor/SkeletonDebugEditor.cs.meta deleted file mode 100644 index 29b7b800a..000000000 --- a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/Editor/SkeletonDebugEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3e60ef41778c8e84e958675f00ce83e8 -timeCreated: 1494814901 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/SkeletonDebug.cs b/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/SkeletonDebug.cs deleted file mode 100644 index 40034d1e2..000000000 --- a/spine-unity/Assets/spine-unity/Modules/SkeletonDebug/SkeletonDebug.cs +++ /dev/null @@ -1,6 +0,0 @@ -using UnityEngine; - -namespace Spine.Unity.Modules { - [DisallowMultipleComponent] - public class SkeletonDebug : MonoBehaviour { } -} diff --git a/spine-unity/Assets/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs b/spine-unity/Assets/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs index 8a5dc3997..218c75303 100644 --- a/spine-unity/Assets/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs +++ b/spine-unity/Assets/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs @@ -79,10 +79,19 @@ namespace Spine.Unity.Editor { skeletonUtility.boneRoot = (Transform)EditorGUILayout.ObjectField("Bone Root", skeletonUtility.boneRoot, typeof(Transform), true); - using (new EditorGUI.DisabledGroupScope(skeletonUtility.boneRoot != null)) { + bool hasRootBone = skeletonUtility.boneRoot != null; + using (new EditorGUI.DisabledGroupScope(hasRootBone)) { if (SpineInspectorUtility.LargeCenteredButton(SpawnHierarchyButtonLabel)) SpawnHierarchyContextMenu(); } + + if (hasRootBone) { + if (SpineInspectorUtility.CenteredButton(new GUIContent("Remove Hierarchy"))) { + Undo.RegisterCompleteObjectUndo(skeletonUtility, "Remove Hierarchy"); + Undo.DestroyObjectImmediate(skeletonUtility.boneRoot.gameObject); + skeletonUtility.boneRoot = null; + } + } } void SpawnHierarchyContextMenu () {