void OnGUI()
	{
		// start the scroll view
		scrollPos = EditorGUILayout.BeginScrollView (scrollPos);

		// store if the GUI is enabled so we can restore it later
		bool guiEnabled = GUI.enabled;

		sm = (sMode) EditorGUI.EnumPopup ( EditorGUILayout.GetControlRect(), "Selection Mode:", sm);
			setMode ();
		
		if(GUI.Button(EditorGUILayout.GetControlRect(), "DO IT!"))
			performMode();

		// restore the GUI
		GUI.enabled = guiEnabled;
		
		// close the scroll view
		EditorGUILayout.EndScrollView();
	} 
Example #2
0
    void OnGUI()
    {
        // start the scroll view
        scrollPos = EditorGUILayout.BeginScrollView(scrollPos);

        // store if the GUI is enabled so we can restore it later
        bool guiEnabled = GUI.enabled;

        sm = (sMode)EditorGUI.EnumPopup(EditorGUILayout.GetControlRect(), "Selection Mode:", sm);
        setMode();

        if (GUI.Button(EditorGUILayout.GetControlRect(), "DO IT!"))
        {
            performMode();
        }

        // restore the GUI
        GUI.enabled = guiEnabled;

        // close the scroll view
        EditorGUILayout.EndScrollView();
    }