使用预定义GUI样式(GUI.skin.customStyles)

作者:追风剑情 发布于:2017-8-24 17:15 分类:Unity3d

Unity预定义的样式全在这GUI.skin.customStyles[]里,Unity4.7中有486种。

代码示例


using UnityEngine;
using UnityEditor;
using System.Text;
using System.Collections;

[CustomEditor(typeof(Test))]
[CanEditMultipleObjects]
public class TestInspector : Editor
{
    protected Test mTest;
    protected virtual void OnEnable()
    {
        mTest = target as Test;
    }

    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        EditorGUILayout.BeginVertical();
        //使用Unity预定义样式
        string styleName = GUI.skin.customStyles[0].name;
        GUILayout.Button(styleName, styleName);
        EditorGUILayout.BeginVertical();
    }
}


部分样式截图

1111.png

22222.png

3333.png

44444.png

666.png

7777.png


Unity 2021.3 所有预定义样式名称(即,GUI.skin.customStyles[i].name)

AboutWIndowLicenseLabel
AC BoldHeader
AC Button
AC ComponentButton
AC GroupButton
AC LeftArrow
AC PreviewHeader
AC PreviewText
AC RightArrow
AM ChannelStripHeaderStyle
AM EffectName
AM HeaderStyle
AM MixerHeader
AM MixerHeader2
AM ToolbarLabel
AM ToolbarObjectField
AM TotalVuLabel
AM VuValue
AnimationEventBackground
AnimationEventTooltip
AnimationEventTooltipArrow
AnimationKeyframeBackground
AnimationPlayHead
AnimationRowEven
AnimationRowOdd
AnimationSelectionTextField
AnimationTimelineTick
AnimClipToolbar
AnimClipToolbarButton
AnimClipToolbarPopup
AnimItemBackground
AnimLeftPaneSeparator
AnimPlayToolbar
AnimPropDropdown
AppCommand
AppCommandLeft
AppCommandLeftOn
AppCommandMid
AppCommandRight
AppToolbar
AppToolbarButtonLeft
AppToolbarButtonMid
AppToolbarButtonRight
ArrowNavigationLeft
ArrowNavigationRight
AssetLabel
AssetLabel Icon
AssetLabel Partial
AvatarMappingBox
AvatarMappingErrorLabel
AxisLabelNumberField
Badge
BoldLabel
BoldTextField
BoldToggle
BottomShadowInwards
BreadcrumbsSeparator
ButtonLeft
ButtonMid
ButtonRight
BypassToggle
CacheFolderLocation
CenteredLabel
ChannelStripAttenuationBar
ChannelStripAttenuationMarkerSquare
ChannelStripBg
ChannelStripDuckingMarker
ChannelStripEffectBar
ChannelStripSendReturnBar
ChannelStripVUMeterBg
CircularToggle
CN Box
CN CenteredText
CN CountBadge
CN EntryBackEven
CN EntryBackOdd
CN EntryError
CN EntryErrorIcon
CN EntryErrorIconSmall
CN EntryErrorSmall
CN EntryInfo
CN EntryInfoIcon
CN EntryInfoIconSmall
CN EntryInfoSmall
CN EntryWarn
CN EntryWarnIcon
CN EntryWarnIconSmall
CN EntryWarnSmall
CN Message
CN StacktraceBackground
CN StacktraceStyle
CN StatusError
CN StatusInfo
CN StatusWarn
ColorField
ColorPicker2DThumb
ColorPickerBackground
ColorPickerBox
ColorPickerCurrentColor
ColorPickerCurrentExposureSwatchBorder
ColorPickerExposureSwatch
ColorPickerHorizThumb
ColorPickerHueRing
ColorPickerHueRing HDR
ColorPickerHueRingThumb
ColorPickerOriginalColor
ColorPickerSliderBackground
Command
CommandLeft
CommandMid
CommandRight
ContentToolbar
ControlHighlight
ControlLabel
CurveEditorBackground
CurveEditorLabelTickmarks
CurveEditorLabelTickmarksOverflow
CurveEditorRightAlignedLabel
DD Background
DD HeaderStyle
DD ItemCheckmark
DD ItemStyle
DD LargeItemStyle
DefaultCenteredLargeText
DefaultCenteredText
DefaultLineSeparator
dockarea
dockareaOverlay
dockareaStandalone
dockHeader
DopesheetBackground
Dopesheetkeyframe
DopesheetRippleLeft
DopesheetRippleRight
DopesheetScaleLeft
DopesheetScaleRight
dragtab
dragtab first
dragtab scroller next
dragtab scroller prev
dragtabdropwindow
DropDown
DropDownButton
DropDownToggleButton
DropzoneStyle
EditModeSingleButton
ErrorLabel
ExposablePopupItem
ExposablePopupMenu
EyeDropperHorizontalLine
EyeDropperPickedPixel
EyeDropperVerticalLine
FloatFieldLinkButton
flow background
flow node 0
flow node 0 on
flow node 1
flow node 1 on
flow node 2
flow node 2 on
flow node 3
flow node 3 on
flow node 4
flow node 4 on
flow node 5
flow node 5 on
flow node 6
flow node 6 on
flow node base
flow node hex 0
flow node hex 0 on
flow node hex 1
flow node hex 1 on
flow node hex 2
flow node hex 2 on
flow node hex 3
flow node hex 3 on
flow node hex 4
flow node hex 4 on
flow node hex 5
flow node hex 5 on
flow node hex 6
flow node hex 6 on
flow node hex base
flow node titlebar
flow target in
flow triggerPin in
flow triggerPin out
flow varPin in
flow varPin out
flow varPin tooltip
Foldout
FoldoutHeader
FoldoutHeaderIcon
FoldOutPreDrop
Frame
FrameBox
GameViewBackground
Grad Down Swatch
Grad Down Swatch Overlay
Grad Up Swatch
Grad Up Swatch Overlay
grey_border
GridList
GridListText
GroupBox
GUIEditor.BreadcrumbLeft
GUIEditor.BreadcrumbLeftBackground
GUIEditor.BreadcrumbMid
GUIEditor.BreadcrumbMidBackground
GV Gizmo DropDown
HeaderButton
HeaderLabel
HelpBox
Hi Label
HorizontalMinMaxScrollbarThumb
HorizontalSliderThumbExtent
hostview
HoverHighlight
IconButton
IN BigTitle
IN BigTitle Inner
IN BigTitle Post
IN CenteredLabel
IN DropDown
IN EditColliderButton
IN Foldout
IN Footer
IN Label
IN LockButton
IN MinMaxStateDropDown
IN ObjectField
IN TextField
IN ThumbnailSelection
IN ThumbnailShadow
IN Title
IN Title Flat
IN TitleText
IN TypeSelection
InnerShadowBg
InsertionMarker
InvisibleButton
LargeBoldLabel
LargeButton
LargeButtonLeft
LargeButtonMid
LargeButtonRight
LargeLabel
LightmapEditorSelectedHighlight
LinkLabel
LODBlackBox
LODCameraLine
LODLevelNotifyText
LODRendererAddButton
LODRendererButton
LODRendererRemove
LODRenderersText
LODSceneText
LODSliderBG
LODSliderRange
LODSliderRangeSelected
LODSliderText
LODSliderTextSelected
MeBlendBackground
MeBlendPosition
MeBlendTriangleLeft
MeBlendTriangleRight
MeLivePlayBackground
MeLivePlayBar
MenuItem
MenuItemMixed
MenuToggleItem
MeTimeBlockLeft
MeTimeBlockRight
MeTimeLabel
MeTransitionBack
MeTransitionBlock
MeTransitionHandleLeft
MeTransitionHandleLeftPrev
MeTransitionHandleRight
MeTransitionHead
MeTransitionSelect
MeTransitionSelectHead
MeTransOff2On
MeTransOffLeft
MeTransOffRight
MeTransOn2Off
MeTransOnLeft
MeTransOnRight
MeTransPlayhead
MiniBoldLabel
minibutton
minibuttonleft
minibuttonmid
minibuttonright
MiniLabel
MiniMinMaxSliderHorizontal
MiniMinMaxSliderVertical
MiniPopup
MiniPullDown
MiniSliderHorizontal
MiniSliderVertical
MiniTextField
MiniToolbarButton
MiniToolbarButtonLeft
MinMaxHorizontalSliderThumb
MultiColumnArrow
MultiColumnHeader
MultiColumnHeaderCenter
MultiColumnHeaderRight
MultiColumnTopBar
MuteToggle
NotificationBackground
NotificationText
ObjectField
ObjectFieldButton
ObjectFieldMiniThumb
ObjectFieldThumb
ObjectFieldThumbLightmapPreviewOverlay
ObjectFieldThumbOverlay
ObjectFieldThumbOverlay2
ObjectPickerBackground
ObjectPickerLargeStatus
ObjectPickerPreviewBackground
ObjectPickerResultsEven
ObjectPickerResultsGrid
ObjectPickerResultsOdd
ObjectPickerSmallStatus
ObjectPickerTab
ObjectPickerToolbar
OffsetDropDown
OL box
OL box flat
OL box NoExpand
OL EntryBackEven
OL EntryBackOdd
OL Label
OL MiniPing
OL MiniRenameField
OL Minus
OL Ping
OL Plus
OL ResultFocusMarker
OL ResultLabel
OL RightLabel
OL SelectedRow
OL Title
OL Title TextRight
OL Toggle
OL ToggleMixed
OL ToggleWhite
OT BottomBar
OT TopBar
OverrideMargin
PaneOptions
PlayerSettingsLevel
PlayerSettingsPlatform
Popup
PopupCurveDropdown
PopupCurveEditorBackground
PopupCurveEditorSwatch
PopupCurveSwatchBackground
PR BrokenPrefabLabel
PR DisabledBrokenPrefabLabel
PR DisabledLabel
PR DisabledPrefabLabel
PR Insertion
PR Label
PR Ping
PR PrefabLabel
PR TextField
PreBackground
PreBackgroundSolid
PreButton
PreButtonBlue
PreButtonGreen
PreButtonRed
PreDropDown
PreferencesKeysElement
PreferencesSection
PreferencesSectionBox
PrefixLabel
PreHorizontalScrollbar
PreHorizontalScrollbarThumb
PreLabel
PreLabelUpper
PreMiniLabel
PreOverlayLabel
PreSlider
PreSliderThumb
PreToolbar
PreToolbar2
PreVerticalScrollbar
PreVerticalScrollbarThumb
PreviewPackageInUse
ProfilerBadge
ProfilerDetailViewBackground
ProfilerGraphBackground
ProfilerHeaderLabel
ProfilerLeftPane
ProfilerNoDataAvailable
ProfilerNotSupportedWarningLabel
ProfilerPaneSubLabel
ProfilerRightPane
ProfilerScrollviewBackground
ProfilerSelectedLabel
ProfilerTimelineBar
ProfilerTimelineDigDownArrow
ProfilerTimelineFoldout
ProfilerTimelineLeftPane
ProfilerTimelineRollUpArrow
ProgressBarBack
ProgressBarBar
ProgressBarText
ProjectBrowserBottomBarBg
ProjectBrowserGridLabel
ProjectBrowserHeaderBgMiddle
ProjectBrowserHeaderBgTop
ProjectBrowserIconAreaBg
ProjectBrowserIconDropShadow
ProjectBrowserPreviewBg
ProjectBrowserSubAssetBg
ProjectBrowserSubAssetBgCloseEnded
ProjectBrowserSubAssetBgDivider
ProjectBrowserSubAssetBgMiddle
ProjectBrowserSubAssetBgOpenEnded
ProjectBrowserSubAssetExpandBtn
ProjectBrowserSubAssetExpandBtnMedium
ProjectBrowserSubAssetExpandBtnSmall
ProjectBrowserTextureIconDropShadow
ProjectBrowserTopBarBg
QualitySettingsDefault
quick search tab
Radio
RectangleToolHBar
RectangleToolHBarLeft
RectangleToolHBarRight
RectangleToolHighlight
RectangleToolRippleLeft
RectangleToolRippleRight
RectangleToolScaleBottom
RectangleToolScaleLeft
RectangleToolScaleRight
RectangleToolScaleTop
RectangleToolSelection
RectangleToolVBar
RectangleToolVBarBottom
RectangleToolVBarTop
RegionBg
ReorderableList
ReorderableListRightAligned
RightAlignedLabel
RightLabel
RL Background
RL DragHandle
RL Element
RL Empty Header
RL Footer
RL FooterButton
RL Header
SC ViewAxisLabel
SC ViewLabel
SC ViewLabelCentered
SC ViewLabelLeftAligned
SceneTopBarBg
SceneViewOverlayTransparentBackground
SceneVisibility
ScriptText
ScrollViewAlt
SearchCancelButton
SearchCancelButtonEmpty
SearchModeFilter
SearchTextField
SelectionRect
SettingsHeader
SettingsIconButton
SettingsListItem
SettingsTreeItem
ShurikenCheckMark
ShurikenCheckMarkMixed
ShurikenDropdown
ShurikenEditableLabel
ShurikenEffectBg
ShurikenEmitterTitle
ShurikenLabel
ShurikenMinus
ShurikenModuleBg
ShurikenModuleTitle
ShurikenObjectField
ShurikenPlus
ShurikenPopup
ShurikenToggle
ShurikenToggleMixed
ShurikenValue
SliderMixed
SoloToggle
StaticDropdown
StatusBarIcon
sv_iconselector_back
sv_iconselector_button
sv_iconselector_labelselection
sv_iconselector_selection
sv_iconselector_sep
sv_label_0
sv_label_1
sv_label_2
sv_label_3
sv_label_4
sv_label_5
sv_label_6
sv_label_7
Tab first
Tab last
Tab middle
Tab onlyOne
TabWindowBackground
Tag MenuItem
TE BoxBackground
TE DefaultTime
TE DropField
TE ElementBackground
TE NodeBackground
TE NodeBox
TE NodeBoxSelected
TE NodeLabelBot
TE NodeLabelTop
TE PinLabel
TE Toolbar
TE toolbarbutton
TE ToolbarDropDown
TextFieldDropDown
TextFieldDropDownText
TimeAreaToolbar
TimeRulerBackground
TimeScrubber
TimeScrubberButton
Titlebar Foldout
TL InPoint
TL OutPoint
TL Playhead
ToggleMixed
Toolbar
ToolbarBoldLabel
ToolbarBottom
toolbarbutton
ToolbarButtonFlat
toolbarbuttonLeft
toolbarbuttonRight
ToolbarCreateAddNewDropDown
ToolbarDropDown
ToolbarDropDownLeft
ToolbarDropDownRight
ToolbarDropDownToggle
ToolbarDropDownToggleButton
ToolbarDropDownToggleRight
ToolbarLabel
ToolbarPopup
ToolbarPopupLeft
ToolbarPopupRight
ToolbarSearchCancelButton
ToolbarSearchCancelButtonEmpty
ToolbarSearchCancelButtonWithJump
ToolbarSearchCancelButtonWithJumpEmpty
ToolbarSearchField
ToolbarSearchTextField
ToolbarSearchTextFieldJumpButton
ToolbarSearchTextFieldPopup
ToolbarSearchTextFieldWithJump
ToolbarSearchTextFieldWithJumpPopup
ToolbarSearchTextFieldWithJumpPopupSynced
ToolbarSearchTextFieldWithJumpSynced
ToolbarSlider
ToolbarSliderTextField
ToolbarTextField
Tooltip
TV Insertion
TV InsertionRelativeToSibling
TV Line
TV LineBold
TV Ping
TV Selection
U2D.createRect
U2D.dragDot
U2D.dragDotActive
U2D.dragDotDimmed
U2D.pivotDot
U2D.pivotDotActive
VerticalMinMaxScrollbarThumb
VerticalSliderThumbExtent
VideoClipImporterLabel
WarningOverlay
WhiteBackground
WhiteBoldLabel
WhiteLabel
WhiteLargeCenterLabel
WhiteLargeLabel
WhiteMiniLabel
WinBtn
WinBtnClose
WinBtnCloseMac
WinBtnInactiveMac
WinBtnMax
WinBtnMaxMac
WinBtnMinMac
WinBtnRestore
WinBtnRestoreMac
WindowBottomResize
Wizard Box
Wizard Error
WordWrapLabel
wordwrapminibutton
WordWrappedLabel
WordWrappedMiniLabel

标签: Unity3d

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号