Skip to content

Instantly share code, notes, and snippets.

@bingomanatee
Created July 28, 2011 16:46
Show Gist options
  • Save bingomanatee/1111914 to your computer and use it in GitHub Desktop.
Save bingomanatee/1111914 to your computer and use it in GitHub Desktop.
unity Editor dialog
class MyDialog extends EditorWindow {
@MenuItem("Terrain/Dialog Test")
static function ShowWindow() {
var window:MyDialog = EditorWindow.GetWindow(MyDialog);
}
static function load_section(){
print('load section');
}
var section_id = "";
function OnGUI() {
section_id = GUI.TextField( Rect(20, 40, 200, 30), section_id);
if (GUI.Button( Rect (220, 40, 80, 20), "Load Terrain")){
MyDialog.load_section();
}
if (GUI.Button( Rect (220, 140, 80, 20), "2 Terrain")){
print ('button clicked');
// load_section(section_id);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment