//Update function with the Menu private void Update() { if (CurrentMenu.Menu.Selection == cMenu.GetCurrentMenu() && currentVolume != null) { if (CurrentMenu.Selection.SetOperation == cMenu.GetCurrentMenuSelection()) { switch (cMenu.GetCurrentMenuSetOperation()) { case CurrentMenu.SetOperation.SetUnion: if (test != 0) { BoolUpdate(OrBoolOperation); test = 0; } break; case CurrentMenu.SetOperation.SetIntersection: if (test != 1) { BoolUpdate(AndBoolOperation); test = 1; } break; case CurrentMenu.SetOperation.SetRelativeComplement: if (test != 2) { BoolUpdate(NotInBoolOperation); test = 2; } break; default: if (cMenu.SetOperationIsConfirmed() && test != 3) { currentSelectedDataPoints = ScatterPlot.GetSelectedPoints(currentVolume); currentSelectedDataPoints = BoolOperationMain(currentSelectedDataPoints); OperationData.Add(new List <DataPoint>(currentSelectedDataPoints)); Coloration(currentSelectedDataPoints); cMenu.ResetSetOperation(); test = 3; } break; } } } }
private bool MenuManager() // MenuManager returns true if it changed a page { // Checks whether a button is pressed switch (cMenu.GetCurrentMenu()) { case CurrentMenu.Menu.Selection: { switch (cMenu.GetCurrentMenuSelection()) { case CurrentMenu.Selection.SetOperation: // Set Operation Menu behavior { if (ButtonCreation.isPressed || Input.GetKey("c")) { cMenu.ResetSetOperation(); cMenu.SetSetOperation(CurrentMenu.SetOperation.SetIntersection); return(true); } if (ButtonSelection.isPressed || Input.GetKey("e")) { cMenu.ResetSetOperation(); cMenu.SetSetOperation(CurrentMenu.SetOperation.SetUnion); return(true); } if (ButtonStatistics.isPressed || Input.GetKey("t")) { cMenu.ResetSetOperation(); cMenu.SetSetOperation(CurrentMenu.SetOperation.SetRelativeComplement); return(true); } if (ButtonHide_Show.isPressed || Input.GetKey("h")) { cMenu.ConfirmSetOperation(); cMenu.SetSetOperation(CurrentMenu.SetOperation.NoOperation); return(true); } if (ButtonHelp_Options.isPressed || Input.GetKey("o")) { cMenu.ResetSetOperation(); cMenu.SetSetOperation(CurrentMenu.SetOperation.Return); cMenu.SetSelection(CurrentMenu.Selection.NoSelection); cMenu.SetSetOperation(CurrentMenu.SetOperation.NoOperation); return(true); } break; } default: //Selection Menu behavior { if (ButtonCreation.isPressed || Input.GetKey("c")) { cMenu.SetSelection(CurrentMenu.Selection.Modification); return(true); } if (ButtonSelection.isPressed || Input.GetKey("e")) { cMenu.SetSelection(CurrentMenu.Selection.Erase); return(true); } if (ButtonStatistics.isPressed || Input.GetKey("t")) { cMenu.SetSelection(CurrentMenu.Selection.SetOperation); return(true); } if (ButtonHide_Show.isPressed || Input.GetKey("h")) { cMenu.SetSelection(CurrentMenu.Selection.Return); cMenu.SetMenu(CurrentMenu.Menu.NoMenuSelected); cMenu.SetSelection(CurrentMenu.Selection.NoSelection); return(true); } break; } } break; } default: // General Menu Behavior { if (ButtonCreation.isPressed || Input.GetKeyDown("c")) { cMenu.SetMenu(CurrentMenu.Menu.Creation); return(true); } if (ButtonSelection.isPressed || Input.GetKeyDown("e")) { cMenu.SetMenu(CurrentMenu.Menu.Selection); return(true); } if (ButtonStatistics.isPressed || Input.GetKeyDown("t")) { /* For the statistics, press once the button to show the stats. * Press it again to hide the stats */ if (cMenu.GetCurrentMenu() == CurrentMenu.Menu.Statistics) { cMenu.SetMenu(CurrentMenu.Menu.NoMenuSelected); } else { cMenu.SetMenu(CurrentMenu.Menu.Statistics); } return(true); } if (ButtonHide_Show.isPressed || Input.GetKeyDown("h")) { if (cMenu.GetCurrentMenu() == CurrentMenu.Menu.Hide_Show) { cMenu.SetMenu(CurrentMenu.Menu.NoMenuSelected); } else { cMenu.SetMenu(CurrentMenu.Menu.Hide_Show); } return(true); } if (ButtonHelp_Options.isPressed || Input.GetKeyDown("o")) { /* For the help, press once the button to show the them. * Press it again to hide the stats */ if (cMenu.GetCurrentMenu() == CurrentMenu.Menu.Help_Options) { cMenu.SetMenu(CurrentMenu.Menu.NoMenuSelected); } else { cMenu.SetMenu(CurrentMenu.Menu.Help_Options); } return(true); } if (ButtonQuit.isPressed || Input.GetKeyDown("escape")) { cMenu.SetMenu(CurrentMenu.Menu.Quit); Application.Quit(); UnityEditor.EditorApplication.isPlaying = false; } break; } } return(false); }