Unity 框架

GUIStyleExampleWindow.cs 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. namespace TFramework
  6. {
  7. public sealed class GUIStyleExampleWindow : EditorWindow
  8. {
  9. private static readonly string[] mList =
  10. {
  11. "AboutWIndowLicenseLabel" ,
  12. "AC LeftArrow" ,
  13. "AC RightArrow" ,
  14. "AnimationCurveEditorBackground" ,
  15. "AnimationEventBackground" ,
  16. "AnimationEventTooltip" ,
  17. "AnimationEventTooltipArrow" ,
  18. "AnimationKeyframeBackground" ,
  19. "AnimationRowEven" ,
  20. "AnimationRowOdd" ,
  21. "AnimationSelectionTextField" ,
  22. "AnimationTimelineTick" ,
  23. "AnimPropDropdown" ,
  24. "AppToolbar" ,
  25. "AS TextArea" ,
  26. "BoldLabel" ,
  27. "BoldToggle" ,
  28. "ButtonLeft" ,
  29. "ButtonMid" ,
  30. "ButtonRight" ,
  31. "CN Box" ,
  32. "CN CountBadge" ,
  33. "CN EntryBackEven" ,
  34. "CN EntryBackOdd" ,
  35. "CN EntryError" ,
  36. "CN EntryInfo" ,
  37. "CN EntryWarn" ,
  38. "CN Message" ,
  39. "CN StatusError" ,
  40. "CN StatusInfo" ,
  41. "CN StatusWarn" ,
  42. "ColorField" ,
  43. "ColorPicker2DThumb" ,
  44. "ColorPickerBackground" ,
  45. "ColorPickerBox" ,
  46. "ColorPickerHorizThumb" ,
  47. "ColorPickerVertThumb" ,
  48. "Command" ,
  49. "CommandLeft" ,
  50. "CommandMid" ,
  51. "CommandRight" ,
  52. "ControlLabel" ,
  53. "CurveEditorLabelTickmarks" ,
  54. "debug_layout_box" ,
  55. "dockarea" ,
  56. "dockareaOverlay" ,
  57. "dockareaStandalone" ,
  58. "dragtab" ,
  59. "dragtabbright" ,
  60. "dragtabdropwindow" ,
  61. "DropDown" ,
  62. "DropDownButton" ,
  63. "ErrorLabel" ,
  64. "ExposablePopupItem" ,
  65. "ExposablePopupMenu" ,
  66. "EyeDropperHorizontalLine" ,
  67. "EyeDropperPickedPixel" ,
  68. "EyeDropperVerticalLine" ,
  69. "flow background" ,
  70. "flow navbar back" ,
  71. "flow navbar button" ,
  72. "flow navbar separator" ,
  73. "flow node 0" ,
  74. "flow node 0 on" ,
  75. "flow node 1" ,
  76. "flow node 1 on" ,
  77. "flow node 2" ,
  78. "flow node 2 on" ,
  79. "flow node 3" ,
  80. "flow node 3 on" ,
  81. "flow node 4" ,
  82. "flow node 4 on" ,
  83. "flow node 5" ,
  84. "flow node 5 on" ,
  85. "flow node 6" ,
  86. "flow node 6 on" ,
  87. "flow node hex 0" ,
  88. "flow node hex 0 on" ,
  89. "flow node hex 1" ,
  90. "flow node hex 1 on" ,
  91. "flow node hex 2" ,
  92. "flow node hex 2 on" ,
  93. "flow node hex 3" ,
  94. "flow node hex 3 on" ,
  95. "flow node hex 4" ,
  96. "flow node hex 4 on" ,
  97. "flow node hex 5" ,
  98. "flow node hex 5 on" ,
  99. "flow node hex 6" ,
  100. "flow node hex 6 on" ,
  101. "flow node titlebar" ,
  102. "flow overlay area left" ,
  103. "flow overlay area right" ,
  104. "flow overlay box" ,
  105. "flow overlay foldout" ,
  106. "flow overlay header lower left" ,
  107. "flow overlay header lower right" ,
  108. "flow overlay header upper left" ,
  109. "flow overlay header upper right" ,
  110. "flow shader in 0" ,
  111. "flow shader in 1" ,
  112. "flow shader in 2" ,
  113. "flow shader in 3" ,
  114. "flow shader in 4" ,
  115. "flow shader in 5" ,
  116. "flow shader node 0" ,
  117. "flow shader node 0 on" ,
  118. "flow shader out 0" ,
  119. "flow shader out 1" ,
  120. "flow shader out 2" ,
  121. "flow shader out 3" ,
  122. "flow shader out 4" ,
  123. "flow shader out 5" ,
  124. "flow target in" ,
  125. "flow triggerPin in" ,
  126. "flow triggerPin out" ,
  127. "flow var 0" ,
  128. "flow var 0 on" ,
  129. "flow var 1" ,
  130. "flow var 1 on" ,
  131. "flow var 2" ,
  132. "flow var 2 on" ,
  133. "flow var 3" ,
  134. "flow var 3 on" ,
  135. "flow var 4" ,
  136. "flow var 4 on" ,
  137. "flow var 5" ,
  138. "flow var 5 on" ,
  139. "flow var 6" ,
  140. "flow var 6 on" ,
  141. "flow varPin in" ,
  142. "flow varPin out" ,
  143. "flow varPin tooltip" ,
  144. "Foldout" ,
  145. "FoldOutPreDrop" ,
  146. "GameViewBackground" ,
  147. "Grad Down Swatch" ,
  148. "Grad Down Swatch Overlay" ,
  149. "Grad Up Swatch" ,
  150. "Grad Up Swatch Overlay" ,
  151. "grey_border" ,
  152. "GridList" ,
  153. "GridListText" ,
  154. "GridToggle" ,
  155. "GroupBox" ,
  156. "GUIEditor.BreadcrumbLeft" ,
  157. "GUIEditor.BreadcrumbMid" ,
  158. "GV Gizmo DropDown" ,
  159. "HeaderLabel" ,
  160. "HelpBox" ,
  161. "Hi Label" ,
  162. "HorizontalMinMaxScrollbarThumb" ,
  163. "hostview" ,
  164. "IN BigTitle" ,
  165. "IN BigTitle Inner" ,
  166. "IN ColorField" ,
  167. "IN DropDown" ,
  168. "IN Foldout" ,
  169. "IN FoldoutStatic" ,
  170. "IN Label" ,
  171. "IN LockButton" ,
  172. "IN ObjectField" ,
  173. "IN Popup" ,
  174. "IN SelectedLine" ,
  175. "IN TextField" ,
  176. "IN ThumbnailSelection" ,
  177. "IN ThumbnailShadow" ,
  178. "IN Title" ,
  179. "IN TitleText" ,
  180. "IN Toggle" ,
  181. "InnerShadowBg" ,
  182. "InvisibleButton" ,
  183. "LargeButton" ,
  184. "LargeButtonLeft" ,
  185. "LargeButtonMid" ,
  186. "LargeButtonRight" ,
  187. "LargeDropDown" ,
  188. "LargeLabel" ,
  189. "LargePopup" ,
  190. "LargeTextField" ,
  191. "LightmapEditorSelectedHighlight" ,
  192. "ListToggle" ,
  193. "LockedHeaderBackground" ,
  194. "LockedHeaderButton" ,
  195. "LockedHeaderLabel" ,
  196. "LODBlackBox" ,
  197. "LODCameraLine" ,
  198. "LODLevelNotifyText" ,
  199. "LODRendererAddButton" ,
  200. "LODRendererButton" ,
  201. "LODRendererRemove" ,
  202. "LODRenderersText" ,
  203. "LODSceneText" ,
  204. "LODSliderBG" ,
  205. "LODSliderRange" ,
  206. "LODSliderRangeSelected" ,
  207. "LODSliderText" ,
  208. "LODSliderTextSelected" ,
  209. "MeBlendBackground" ,
  210. "MeBlendPosition" ,
  211. "MeBlendTriangleLeft" ,
  212. "MeBlendTriangleRight" ,
  213. "MeLivePlayBackground" ,
  214. "MeLivePlayBar" ,
  215. "MeTimeLabel" ,
  216. "MeTransBGOver" ,
  217. "MeTransitionBack" ,
  218. "MeTransitionBlock" ,
  219. "MeTransitionHandleLeft" ,
  220. "MeTransitionHandleLeftPrev" ,
  221. "MeTransitionHandleRight" ,
  222. "MeTransitionHead" ,
  223. "MeTransitionSelect" ,
  224. "MeTransitionSelectHead" ,
  225. "MeTransOff2On" ,
  226. "MeTransOffLeft" ,
  227. "MeTransOffRight" ,
  228. "MeTransOn2Off" ,
  229. "MeTransOnLeft" ,
  230. "MeTransOnRight" ,
  231. "MeTransPlayhead" ,
  232. "MiniBoldLabel" ,
  233. "minibutton" ,
  234. "minibuttonleft" ,
  235. "minibuttonmid" ,
  236. "minibuttonright" ,
  237. "MiniLabel" ,
  238. "MiniLabelRight" ,
  239. "MiniMinMaxSliderHorizontal" ,
  240. "MiniMinMaxSliderVertical" ,
  241. "MiniPopup" ,
  242. "MiniPullDown" ,
  243. "MiniPullDownLeft" ,
  244. "MiniTextField" ,
  245. "MiniToolbarButton" ,
  246. "MiniToolbarButtonLeft" ,
  247. "MiniToolbarPopup" ,
  248. "MinMaxHorizontalSliderThumb" ,
  249. "NotificationBackground" ,
  250. "NotificationText" ,
  251. "ObjectField" ,
  252. "ObjectFieldThumb" ,
  253. "ObjectFieldThumbOverlay" ,
  254. "ObjectFieldThumbOverlay2" ,
  255. "ObjectPickerBackground" ,
  256. "ObjectPickerGroupHeader" ,
  257. "ObjectPickerLargeStatus" ,
  258. "ObjectPickerPreviewBackground" ,
  259. "ObjectPickerResultsEven" ,
  260. "ObjectPickerResultsGrid" ,
  261. "ObjectPickerResultsGridLabel" ,
  262. "ObjectPickerResultsOdd" ,
  263. "ObjectPickerSmallStatus" ,
  264. "ObjectPickerTab" ,
  265. "ObjectPickerToolbar" ,
  266. "OL box" ,
  267. "OL box NoExpand" ,
  268. "OL Elem" ,
  269. "OL EntryBackEven" ,
  270. "OL EntryBackOdd" ,
  271. "OL header" ,
  272. "OL Label" ,
  273. "OL Minus" ,
  274. "OL Plus" ,
  275. "OL TextField" ,
  276. "OL Title" ,
  277. "OL Title TextRight" ,
  278. "OL Titleleft" ,
  279. "OL Titlemid" ,
  280. "OL Titleright" ,
  281. "OL Toggle" ,
  282. "OL ToggleWhite" ,
  283. "PaneOptions" ,
  284. "PlayerSettingsLevel" ,
  285. "PlayerSettingsPlatform" ,
  286. "Popup" ,
  287. "PopupBackground" ,
  288. "PopupCurveDropdown" ,
  289. "PopupCurveEditorBackground" ,
  290. "PopupCurveEditorSwatch" ,
  291. "PopupCurveSwatchBackground" ,
  292. "PR DigDownArrow" ,
  293. "PR Insertion" ,
  294. "PR Label" ,
  295. "PR Ping" ,
  296. "PR TextField" ,
  297. "PreBackground" ,
  298. "PreButton" ,
  299. "PreferencesKeysElement" ,
  300. "PreferencesSection" ,
  301. "PreferencesSectionBox" ,
  302. "PreHorizontalScrollbar" ,
  303. "PreHorizontalScrollbarThumb" ,
  304. "PreLabel" ,
  305. "PreOverlayLabel" ,
  306. "PreSlider" ,
  307. "PreSliderThumb" ,
  308. "PreToolbar" ,
  309. "PreToolbar2" ,
  310. "PreVerticalScrollbar" ,
  311. "PreVerticalScrollbarThumb" ,
  312. "ProfilerBadge" ,
  313. "ProfilerLeftPane" ,
  314. "ProfilerLeftPaneOverlay" ,
  315. "ProfilerPaneLeftBackground" ,
  316. "ProfilerPaneSubLabel" ,
  317. "ProfilerRightPane" ,
  318. "ProfilerScrollviewBackground" ,
  319. "ProfilerSelectedLabel" ,
  320. "ProgressBarBack" ,
  321. "ProgressBarBar" ,
  322. "ProgressBarText" ,
  323. "ProjectBrowserBottomBarBg" ,
  324. "ProjectBrowserGridLabel" ,
  325. "ProjectBrowserHeaderBgMiddle" ,
  326. "ProjectBrowserHeaderBgTop" ,
  327. "ProjectBrowserIconAreaBg" ,
  328. "ProjectBrowserIconDropShadow" ,
  329. "ProjectBrowserPreviewBg" ,
  330. "ProjectBrowserSubAssetBg" ,
  331. "ProjectBrowserSubAssetBgCloseEnded" ,
  332. "ProjectBrowserSubAssetBgDivider" ,
  333. "ProjectBrowserSubAssetBgMiddle" ,
  334. "ProjectBrowserSubAssetBgOpenEnded" ,
  335. "ProjectBrowserSubAssetExpandBtn" ,
  336. "ProjectBrowserTopBarBg" ,
  337. "QualitySettingsDefault" ,
  338. "Radio" ,
  339. "RightLabel" ,
  340. "RL Background" ,
  341. "RL DragHandle" ,
  342. "RL Element" ,
  343. "RL Footer" ,
  344. "RL FooterButton" ,
  345. "RL Header" ,
  346. "SC ViewAxisLabel" ,
  347. "SC ViewLabel" ,
  348. "SceneViewOverlayTransparentBackground" ,
  349. "ScriptText" ,
  350. "SearchCancelButton" ,
  351. "SearchCancelButtonEmpty" ,
  352. "SearchModeFilter" ,
  353. "SearchTextField" ,
  354. "SelectionRect" ,
  355. "ServerChangeCount" ,
  356. "ServerUpdateChangeset" ,
  357. "ServerUpdateChangesetOn" ,
  358. "ServerUpdateInfo" ,
  359. "ServerUpdateLog" ,
  360. "ShurikenCheckMark" ,
  361. "ShurikenEffectBg" ,
  362. "ShurikenEmitterTitle" ,
  363. "ShurikenLabel" ,
  364. "ShurikenLine" ,
  365. "ShurikenMinus" ,
  366. "ShurikenModuleBg" ,
  367. "ShurikenModuleTitle" ,
  368. "ShurikenObjectField" ,
  369. "ShurikenPlus" ,
  370. "ShurikenPopUp" ,
  371. "ShurikenToggle" ,
  372. "ShurikenValue" ,
  373. "SimplePopup" ,
  374. "SliderMixed" ,
  375. "StaticDropdown" ,
  376. "sv_iconselector_back" ,
  377. "sv_iconselector_button" ,
  378. "sv_iconselector_labelselection" ,
  379. "sv_iconselector_selection" ,
  380. "sv_iconselector_sep" ,
  381. "sv_label_0" ,
  382. "sv_label_1" ,
  383. "sv_label_2" ,
  384. "sv_label_3" ,
  385. "sv_label_4" ,
  386. "sv_label_5" ,
  387. "sv_label_6" ,
  388. "sv_label_7" ,
  389. "TabWindowBackground" ,
  390. "Tag MenuItem" ,
  391. "Tag TextField" ,
  392. "Tag TextField Button" ,
  393. "Tag TextField Empty" ,
  394. "TE NodeBackground" ,
  395. "TE NodeBox" ,
  396. "TE NodeBoxSelected" ,
  397. "TE NodeLabelBot" ,
  398. "TE NodeLabelTop" ,
  399. "TE PinLabel" ,
  400. "TE Toolbar" ,
  401. "TE toolbarbutton" ,
  402. "TE ToolbarDropDown" ,
  403. "TimeScrubber" ,
  404. "TimeScrubberButton" ,
  405. "TL BaseStateLogicBarOverlay" ,
  406. "TL EndPoint" ,
  407. "TL InPoint" ,
  408. "TL ItemTitle" ,
  409. "TL LeftColumn" ,
  410. "TL LeftItem" ,
  411. "TL LogicBar 0" ,
  412. "TL LogicBar 1" ,
  413. "TL LogicBar parentgrey" ,
  414. "TL LoopSection" ,
  415. "TL OutPoint" ,
  416. "TL Playhead" ,
  417. "TL Range Overlay" ,
  418. "TL RightLine" ,
  419. "TL Selection H1" ,
  420. "TL Selection H2" ,
  421. "TL SelectionBarCloseButton" ,
  422. "TL SelectionBarPreview" ,
  423. "TL SelectionBarText" ,
  424. "TL SelectionButton" ,
  425. "TL SelectionButton PreDropGlow" ,
  426. "TL SelectionButtonName" ,
  427. "TL SelectionButtonNew" ,
  428. "TL tab left" ,
  429. "TL tab mid" ,
  430. "TL tab plus left" ,
  431. "TL tab plus right" ,
  432. "TL tab right" ,
  433. "ToggleMixed" ,
  434. "Toolbar" ,
  435. "toolbarbutton" ,
  436. "ToolbarDropDown" ,
  437. "ToolbarPopup" ,
  438. "ToolbarSeachCancelButton" ,
  439. "ToolbarSeachCancelButtonEmpty" ,
  440. "ToolbarSeachTextField" ,
  441. "ToolbarSeachTextFieldPopup" ,
  442. "ToolbarSearchField" ,
  443. "ToolbarTextField" ,
  444. "Tooltip" ,
  445. "U2D.createRect" ,
  446. "U2D.dragDot" ,
  447. "U2D.dragDotDimmed" ,
  448. "VCS_StickyNote" ,
  449. "VCS_StickyNoteArrow" ,
  450. "VCS_StickyNoteLabel" ,
  451. "VCS_StickyNoteP4" ,
  452. "VerticalMinMaxScrollbarThumb" ,
  453. "VisibilityToggle" ,
  454. "WhiteBoldLabel" ,
  455. "WhiteLabel" ,
  456. "WhiteLargeLabel" ,
  457. "WhiteMiniLabel" ,
  458. "WinBtnCloseActiveMac" ,
  459. "WinBtnCloseMac" ,
  460. "WinBtnCloseWin" ,
  461. "WinBtnInactiveMac" ,
  462. "WinBtnMaxActiveMac" ,
  463. "WinBtnMaxMac" ,
  464. "WinBtnMaxWin" ,
  465. "WinBtnMinActiveMac" ,
  466. "WinBtnMinMac" ,
  467. "WinBtnMinWin" ,
  468. "WindowBackground" ,
  469. "WindowBottomResize" ,
  470. "WindowResizeMac" ,
  471. "Wizard Box" ,
  472. "Wizard Error" ,
  473. "WordWrapLabel" ,
  474. "WordWrappedLabel" ,
  475. "WordWrappedMiniLabel" ,
  476. "WrappedLabel" ,
  477. };
  478. private Vector2 mScrollPos;
  479. [MenuItem("Tools/GUIStyle ÑùÀý´°¿Ú")]
  480. private static void Example()
  481. {
  482. GetWindow<GUIStyleExampleWindow>(true);
  483. }
  484. private void OnGUI()
  485. {
  486. mScrollPos = EditorGUILayout.BeginScrollView(mScrollPos);
  487. foreach (var n in mList)
  488. {
  489. EditorGUILayout.BeginHorizontal(GUILayout.Height(48));
  490. EditorGUILayout.SelectableLabel(n);
  491. EditorGUILayout.Toggle(false, n);
  492. EditorGUILayout.EndHorizontal();
  493. GUILayout.Box(
  494. string.Empty,
  495. GUILayout.Width(position.width - 24),
  496. GUILayout.Height(1)
  497. );
  498. }
  499. EditorGUILayout.EndScrollView();
  500. }
  501. }
  502. }