Created
August 12, 2017 16:41
-
-
Save kirevdokimov/df5ce980ce992e40a72197bffdb3f130 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ToolBarWindow : EditorWindow{ | |
private static Texture image; | |
[MenuItem("Window/TestChamber/ToolBar")] | |
public static void Init(){ | |
b(); | |
GetWindow<ToolBarWindow>().Show(); | |
} | |
private void OnGUI(){DrawToolbar();} | |
[DidReloadScripts]static void b(){image = Resources.Load("brackets") as Texture;} | |
void DrawToolbar(){ | |
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar)){ | |
GUILayout.Button("Button",EditorStyles.toolbarButton); | |
GUIStyle gs = new GUIStyle(EditorStyles.toolbar){ | |
alignment = TextAnchor.MiddleCenter | |
}; | |
GUILayout.FlexibleSpace(); | |
GUILayout.Label("Label is here ",gs); | |
GUILayout.TextField("Textfield",EditorStyles.toolbarTextField); | |
EditorGUILayout.Popup(2,new string[]{"Hello","Hi","Konichava"},EditorStyles.toolbarPopup); | |
GUILayout.Button(new GUIContent("Button with icon", image, "Tool tip"), EditorStyles.toolbarButton); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment