|
|
|
@ -286,38 +286,39 @@ namespace Fungus.EditorUtils
|
|
|
|
|
if (nodeStyle == null) |
|
|
|
|
{ |
|
|
|
|
nodeStyle = new GUIStyle(); |
|
|
|
|
// All block nodes use the same GUIStyle, but with a different background |
|
|
|
|
nodeStyle.border = new RectOffset(HorizontalPad, HorizontalPad, VerticalPad, VerticalPad); |
|
|
|
|
nodeStyle.padding = nodeStyle.border; |
|
|
|
|
nodeStyle.contentOffset = Vector2.zero; |
|
|
|
|
nodeStyle.alignment = TextAnchor.MiddleCenter; |
|
|
|
|
nodeStyle.wordWrap = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// All block nodes use the same GUIStyle, but with a different background |
|
|
|
|
nodeStyle.border = new RectOffset(HorizontalPad, HorizontalPad, VerticalPad, VerticalPad); |
|
|
|
|
nodeStyle.padding = nodeStyle.border; |
|
|
|
|
nodeStyle.contentOffset = Vector2.zero; |
|
|
|
|
nodeStyle.alignment = TextAnchor.MiddleCenter; |
|
|
|
|
nodeStyle.wordWrap = true; |
|
|
|
|
|
|
|
|
|
if (EditorStyles.helpBox != null && descriptionStyle == null) |
|
|
|
|
{ |
|
|
|
|
descriptionStyle = new GUIStyle(EditorStyles.helpBox); |
|
|
|
|
descriptionStyle.wordWrap = true; |
|
|
|
|
} |
|
|
|
|
descriptionStyle.wordWrap = true; |
|
|
|
|
|
|
|
|
|
if (EditorStyles.whiteLabel != null && handlerStyle == null) |
|
|
|
|
{ |
|
|
|
|
handlerStyle = new GUIStyle(EditorStyles.label); |
|
|
|
|
handlerStyle.wordWrap = true; |
|
|
|
|
handlerStyle.margin.top = 0; |
|
|
|
|
handlerStyle.margin.bottom = 0; |
|
|
|
|
handlerStyle.alignment = TextAnchor.MiddleCenter; |
|
|
|
|
} |
|
|
|
|
handlerStyle.wordWrap = true; |
|
|
|
|
handlerStyle.margin.top = 0; |
|
|
|
|
handlerStyle.margin.bottom = 0; |
|
|
|
|
handlerStyle.alignment = TextAnchor.MiddleCenter; |
|
|
|
|
|
|
|
|
|
if(blockSearchPopupNormalStyle == null || blockSearchPopupSelectedStyle == null) |
|
|
|
|
if (blockSearchPopupNormalStyle == null || blockSearchPopupSelectedStyle == null) |
|
|
|
|
{ |
|
|
|
|
blockSearchPopupNormalStyle = new GUIStyle(GUI.skin.FindStyle("MenuItem")); |
|
|
|
|
blockSearchPopupNormalStyle.padding = new RectOffset(8, 0, 0, 0); |
|
|
|
|
blockSearchPopupNormalStyle.imagePosition = ImagePosition.ImageLeft; |
|
|
|
|
blockSearchPopupSelectedStyle = new GUIStyle(blockSearchPopupNormalStyle); |
|
|
|
|
blockSearchPopupSelectedStyle.normal = blockSearchPopupSelectedStyle.hover; |
|
|
|
|
blockSearchPopupNormalStyle.hover = blockSearchPopupNormalStyle.normal; |
|
|
|
|
} |
|
|
|
|
blockSearchPopupNormalStyle.padding = new RectOffset(8, 0, 0, 0); |
|
|
|
|
blockSearchPopupNormalStyle.imagePosition = ImagePosition.ImageLeft; |
|
|
|
|
blockSearchPopupSelectedStyle = new GUIStyle(blockSearchPopupNormalStyle); |
|
|
|
|
blockSearchPopupSelectedStyle.normal = blockSearchPopupSelectedStyle.hover; |
|
|
|
|
blockSearchPopupNormalStyle.hover = blockSearchPopupNormalStyle.normal; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected virtual void OnDisable() |
|
|
|
|