Exemplo n.º 1
0
        void OnGUI()
        {
            Rect r = this.position;

            r.x = 0;
            r.y = 0;
            Rect scrollRect = r;

            GUI.Box(r, "");
            scrollRect.height = MaxHeight;
            if (colors.Count > maxRows)
            {
                scrollRect.width -= 15;
            }
            scrollV = GUI.BeginScrollView(r, scrollV, scrollRect);

            Rect buttonRect = scrollRect;

            buttonRect.height = rowHeight;
            foreach (ColorGroup colorGroup in colors)
            {
                if (colorGroup == selectedColor)
                {
                    continue;
                }
                ThemeWindow.DrawColorGroupHorizontal(buttonRect, colorGroup, () =>
                {
                    AssignColorGroup(colorGroup);
                });
                buttonRect.y += rowHeight;
            }
            GUI.EndScrollView();
        }
Exemplo n.º 2
0
 public override void OnInspectorGUI()
 {
     if (GUILayout.Button("Open Gamestrap UI Window", GUILayout.Height(50)))
     {
         ThemeWindow.ShowWindow().Theme = (GamestrapTheme)target;
     }
     GUILayout.Space(5f);
     EditorGUILayout.HelpBox("The following buttons will open a tab in your browser", MessageType.None);
     if (GUILayout.Button(website))
     {
         Application.OpenURL(websiteURL);
     }
     if (GUILayout.Button(thread))
     {
         Application.OpenURL(threadURL);
     }
     if (GUILayout.Button(contact))
     {
         Application.OpenURL(contactURL);
     }
     EditorGUILayout.HelpBox("If you are having issues, contact us first.", MessageType.Info);
     if (GUILayout.Button(rate))
     {
         Application.OpenURL(rateURL);
     }
     if (GUILayout.Button(store))
     {
         Application.OpenURL(storeURL);
     }
 }
Exemplo n.º 3
0
 public static ThemeWindow ShowWindow()
 {
     window         = (ThemeWindow)EditorWindow.GetWindow(typeof(ThemeWindow), false, "GSUI");
     window.minSize = minSizeMedium;
     window.autoRepaintOnSceneChange = true;
     return(window);
 }
Exemplo n.º 4
0
 public static bool OpenInProjectWindow(int instanceID, int line)
 {
     UnityEngine.Object obj = EditorUtility.InstanceIDToObject(instanceID);
     if (obj is GamestrapTheme)
     {
         GamestrapTheme theme  = obj as GamestrapTheme;
         ThemeWindow    window = ShowWindow();
         window.Theme = theme;
         return(true);
     }
     return(false);
 }