GUIStyle mystyle = new GUIStyle("some string from the list below");
- "CN Box"
- "Button"
| using UnityEngine; | |
| using UnityEditor; | |
| using System.Text; | |
| [InitializeOnLoad] | |
| public class CustomHierarchyView { | |
| private static StringBuilder sb = new StringBuilder (); | |
| static CustomHierarchyView() { |
| /// <summary> | |
| /// Retrieves selected folder on Project view. | |
| /// </summary> | |
| /// <returns></returns> | |
| public static string GetSelectedPathOrFallback() | |
| { | |
| string path = "Assets"; | |
| foreach (UnityEngine.Object obj in Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Assets)) | |
| { |
| /// <summary> | |
| /// Used to get assets of a certain type and file extension from entire project | |
| /// Usage: | |
| /// UnityEngine.Object[] pagePrefabs = GetAssetsOfType("Resources/Prefabs/PAGE", typeof(GameObject), ".prefab"); | |
| /// </summary> | |
| /// <param name="type">The type to retrieve. eg typeof(GameObject).</param> | |
| /// <param name="fileExtension">The file extention the type uses eg ".prefab".</param> | |
| /// <returns>An Object array of assets.</returns> | |
| public static UnityEngine.Object[] GetAssetsOfType(string path, System.Type type, string fileExtension) | |
| { |
| #if UNITY_EDITOR | |
| using System; | |
| using System.Reflection; | |
| using UnityEditor; | |
| using UnityEngine; | |
| public static class Docker | |
| { | |
| #region Reflection Types |
| #if UNITY_EDITOR | |
| using System.Reflection; | |
| using UnityEngine; | |
| using UnityEditor; | |
| public class FontSwitcher : EditorWindow | |
| { | |
| [MenuItem("Font/Show Window")] | |
| public static void ShowFontWindow() | |
| { |
| // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) | |
| Shader "Hidden/Internal-GUITextureClipText" | |
| { | |
| Properties { _MainTex ("Texture", 2D) = "white" {} } | |
| CGINCLUDE | |
| #pragma vertex vert | |
| #pragma fragment frag |
| using UnityEngine; | |
| using UnityEngine.UI; | |
| public class HexGridLayout : LayoutGroup { | |
| const float SQUARE_ROOT_OF_3 = 1.73205f; | |
| public enum Axis { Horizontal = 0, Vertical = 1 } | |
| public enum Constraint { Flexible = 0, FixedColumnCount = 1, FixedRowCount = 2 } |
| using System; | |
| public static class ActionExtensions { | |
| public static void SafeInvoke(this Action action) { | |
| if (action != null) { | |
| action(); | |
| } | |
| } |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using UnityEditor; | |
| using UnityEditor.Compilation; | |
| [InitializeOnLoad] | |
| public class AsmdefDebug | |
| { | |
| static Dictionary<string, Stopwatch> s_Assemblies = new Dictionary<string, Stopwatch>(); |