[unity] Fixed some Inspector buttons being displayed without border in Unity 2019.3. GuiStyle.Name was the problem. Fixes #1654.

This commit is contained in:
Harald Csaszar 2020-04-07 21:24:26 +02:00
parent 39387b1015
commit 381c23b5fc
3 changed files with 3 additions and 4 deletions

View File

@ -87,7 +87,7 @@ namespace Spine.Unity.Editor {
using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox)) { using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox)) {
EditorGUILayout.HelpBox("It's ideal to add BoundingBoxFollower to a separate child GameObject of the Spine GameObject.", MessageType.Warning); EditorGUILayout.HelpBox("It's ideal to add BoundingBoxFollower to a separate child GameObject of the Spine GameObject.", MessageType.Warning);
if (GUILayout.Button(new GUIContent("Move BoundingBoxFollower to new GameObject", Icons.boundingBox), GUILayout.Height(50f))) { if (GUILayout.Button(new GUIContent("Move BoundingBoxFollower to new GameObject", Icons.boundingBox), GUILayout.Height(30f))) {
AddBoundingBoxFollowerChild(skeletonRendererValue, follower); AddBoundingBoxFollowerChild(skeletonRendererValue, follower);
DestroyImmediate(follower); DestroyImmediate(follower);
return; return;

View File

@ -220,13 +220,12 @@ namespace Spine.Unity.Editor {
#region Button #region Button
const float CenterButtonMaxWidth = 270f; const float CenterButtonMaxWidth = 270f;
const float CenterButtonHeight = 35f; const float CenterButtonHeight = 30f;
static GUIStyle spineButtonStyle; static GUIStyle spineButtonStyle;
static GUIStyle SpineButtonStyle { static GUIStyle SpineButtonStyle {
get { get {
if (spineButtonStyle == null) { if (spineButtonStyle == null) {
spineButtonStyle = new GUIStyle(GUI.skin.button); spineButtonStyle = new GUIStyle(GUI.skin.button);
spineButtonStyle.name = "Spine Button";
spineButtonStyle.padding = new RectOffset(10, 10, 10, 10); spineButtonStyle.padding = new RectOffset(10, 10, 10, 10);
} }
return spineButtonStyle; return spineButtonStyle;

View File

@ -182,7 +182,7 @@ namespace Spine.Unity.Examples {
if (component.enabled && component.SkeletonRenderer != null && extraRenderersNeeded > 0) { if (component.enabled && component.SkeletonRenderer != null && extraRenderersNeeded > 0) {
EditorGUILayout.HelpBox(string.Format("Insufficient parts renderers. Some parts will not be rendered."), MessageType.Warning); EditorGUILayout.HelpBox(string.Format("Insufficient parts renderers. Some parts will not be rendered."), MessageType.Warning);
string addMissingLabel = string.Format("Add the missing renderer{1} ({0}) ", extraRenderersNeeded, SpineInspectorUtility.PluralThenS(extraRenderersNeeded)); string addMissingLabel = string.Format("Add the missing renderer{1} ({0}) ", extraRenderersNeeded, SpineInspectorUtility.PluralThenS(extraRenderersNeeded));
if (GUILayout.Button(addMissingLabel, GUILayout.Height(40f))) { if (GUILayout.Button(addMissingLabel, GUILayout.Height(30f))) {
AddPartsRenderer(extraRenderersNeeded); AddPartsRenderer(extraRenderersNeeded);
DetectOrphanedPartsRenderers(component); DetectOrphanedPartsRenderers(component);
partsRendererInitRequired = true; partsRendererInitRequired = true;