public override void OnGUIEvery() { if (!Visible) { return; } var button_width = StyleFactory.ButtonLaunchStyle.fixedWidth; var button_height = StyleFactory.ButtonLaunchStyle.fixedHeight; switch (_launchState) { case LaunchStates.Normal: //launch if (GUI.Button(new Rect(WindowRect.xMin, WindowRect.yMax - _delta, button_width, button_height), string.Empty, StyleFactory.ButtonLaunchStyle)) { _launcher.Run(); _launchState = LaunchStates.Launch; } //sequence if ( GUI.Button( new Rect(WindowRect.xMin + button_width, WindowRect.yMax - _delta, button_width, button_height), string.Empty, StyleFactory.ButtonSequenceStyle)) { Visible = false; _launchSequenceWindow.WindowRect.x = WindowRect.x; _launchSequenceWindow.WindowRect.y = WindowRect.y; _launchSequenceWindow.Visible = true; _launchState = LaunchStates.Sequence; } //settings if ( GUI.Button( new Rect(WindowRect.xMin + button_width * 2, WindowRect.yMax - _delta, button_width, button_height), string.Empty, StyleFactory.ButtonSettingsStyle)) { Visible = false; _settingsWindow.WindowRect.x = WindowRect.x; _settingsWindow.WindowRect.y = WindowRect.y; _settingsWindow.Visible = true; _launchState = LaunchStates.Settings; } break; case LaunchStates.Launch: //abort if (GUI.Button(new Rect(WindowRect.xMin, WindowRect.yMax - _delta, button_width, button_height), string.Empty, StyleFactory.ButtonAbortStyle)) { _launcher.Abort(); _launchState = LaunchStates.Normal; _tick = 0; } TimeWarp.SetRate(0, false); break; case LaunchStates.Abort: case LaunchStates.Settings: case LaunchStates.Fly: DebugHelper.WriteMessage("Current launch state {0}", _launchState); break; } }