public void drawCenterMenu(layouts layout) { centerMenu.reset(); centerMenu.switchLayout(layout); UI.OnUIChanged.Invoke(); centerMenu.show(); }
public void switchLayoutMainMenu(layouts lay) { mainMenu.switchLayout(layouts.DEFAULT); // HACK mainMenuButton.GetComponent <MenuButtonToggle>().Toggled = false; }
public void addButtonToLayout(IMenuButton newButton, layouts layout) { if (!layoutDict.ContainsKey(layout)) { layoutDict.Add(layout, new List <GameObject>()); } layoutDict[layout].Add(((Button)newButton).gameObject); }
public void addObjectToLayout(GameObject newObj, layouts layout) { if (!layoutDict.ContainsKey(layout)) { layoutDict.Add(layout, new List <GameObject>()); } layoutDict[layout].Add(newObj); }
//! //! adds a button to the menu //! @param active image displayed when button is active //! @param toggle indicate if this is a toggle button //! public void addButton(IMenuButton newButton, layouts layout = layouts.DEFAULT) { GameObject newButtonObj = ((Button)newButton).gameObject; buttons.Add(newButtonObj); newButtonObj.transform.SetParent(this.transform, false); newButtonObj.SetActive(false); addObjectToLayout(newButtonObj, layout); newButton.Menu = this; }
//! //! Empty this menu and remove all buttons from scene //! public void clear() { for (int i = 0; i < buttons.Count; i++) { GameObject.Destroy(buttons[i]); } buttons.Clear(); layoutDict.Clear(); currentLayout = layouts.DEFAULT; GameObject activeButton = null; }
public void drawSecondaryMenu(layouts layout) { print("drawSecondaryMenu " + layout.ToString()); secondaryMenu.switchLayout(layout); //secondaryMenu.TranlationButton.Toggled = false; //secondaryMenu.LinkToCamButton.Toggled = false; //secondaryMenu.PointToShoot.Toggled = false; secondaryMenu.show(); }
private void secondaryMenuSwitchLayout(layouts lay) { if (secondaryMenu.currentLayout == lay) { secondaryMenu.switchLayout(layouts.DEFAULT); } else { secondaryMenu.switchLayout(lay); } secondaryMenu.show(); }
public void drawCenterMenu(layouts layout) { centerMenu.reset(); centerMenu.switchLayout(layout); // invoke gravity event if (mainController.getCurrentSelection() && mainController.getCurrentSelection().GetComponent <SceneObject>()) { mainController.OnObjectGravityChange.Invoke(!mainController.getCurrentSelection().GetComponent <SceneObject>().lockKinematic); } centerMenu.show(); }
private void changeMode(layouts layout) { if (layout == layouts.EDIT || layout == layouts.ANIMATION) { // switch of point to move camera // to generic switch off all tools which might be active through secondary menu if (mainController.ActiveMode == MainController.Mode.pointToMoveMode) { mainController.togglePointToMoveCamera(false); } layoutUI = layout; secondaryMenu.switchLayout(layout); if (mainController.getCurrentSelection() != null) { if (mainController.getCurrentSelection().GetComponent <SceneObject>().IsLight) { mainController.ActiveMode = MainController.Mode.lightMenuMode; } //else if (mainController.getCurrentSelection().GetComponent<SceneObject>().isMocapTrigger) // mocap trigger component at object //{ // mainController.ActiveMode = MainController.Mode.objectMenuMode; // // force re-draw center menu because it won't be re-drawn in state machine if mode doesn't change // drawCenterMenu(layouts.MOCAP); //} else { mainController.ActiveMode = MainController.Mode.objectMenuMode; // force re-draw center menu because it won't be re-drawn in state machine if mode doesn't change drawCenterMenu(layout); } // activate animcontroller when something is selected if (layout == layouts.ANIMATION) { animationController.activate(); } } } else if (layout == layouts.SCOUT) { layoutUI = layout; secondaryMenu.switchLayout(layout); mainController.ActiveMode = MainController.Mode.idle; } UI.OnUIChanged.Invoke(); secondaryMenu.show(); hideRangeSlider(); }
public void drawParameterMenu(layouts layout) { // reset parmater menu and set first button toggled parameterMenu.ActiveButton = null; parameterMenu.reset(); // IMenuButton button = parameterMenu.GetButton(0); parameterMenu.switchLayout(layout); float _adjustOddCount = (parameterMenu.ActiveButtonCount % 2) * UI.ButtonOffset / 2f; parameterMenu.offset = new Vector2(-VPETSettings.Instance.canvasHalfWidth + UI.ButtonOffset, parameterMenu.ActiveButtonCount * UI.ButtonOffset / 2f + _adjustOddCount); if (parameterMenu.ActiveButtonCount > 1) { parameterMenu.show(); } }
//! //! Empty this menu and remove all buttons from scene //! public void clear() { for (int i = 0; i < buttons.Count; i++) { if (buttons[i].name != "TimeLine") // Hack to let TimeLine in Scene { GameObject.Destroy(buttons[i]); } else { buttons[i].SetActive(false); } } buttons.Clear(); layoutDict.Clear(); addLayout(layouts.DEFAULT); currentLayout = layouts.DEFAULT; activeButton = null; }
//! //! Change the current button layout. Hide all buttons and set layout. Next call to method show will set buttons defined in new layout to visible. //! public void switchLayout(layouts layout) { if (layoutDict.ContainsKey(layout)) { print("switchLayout " + layout.ToString()); currentLayout = layout; if (activeButton) { activeButton.SetActive(false); activeButton = null; } // hide all buttons foreach (GameObject g in Buttons()) { g.SetActive(false); } } }
private void changeMode(layouts layout) { if (layout == layouts.EDIT || layout == layouts.ANIMATION) { layoutUI = layout; secondaryMenu.switchLayout(layout); if (mainController.getCurrentSelection() != null) { if (mainController.getCurrentSelection().GetComponent <SceneObject>().IsLight) { mainController.ActiveMode = MainController.Mode.lightMenuMode; } else { mainController.ActiveMode = MainController.Mode.objectMenuMode; // force re-draw center menu because it won't be re-drawn in state machine if mode doesn't change drawCenterMenu(layout); } // activate animcontroller when something is selected if (layout == layouts.ANIMATION) { animationController.activate(); } } } else if (layout == layouts.SCOUT) { layoutUI = layout; secondaryMenu.switchLayout(layout); mainController.ActiveMode = MainController.Mode.idle; } UI.OnUIChanged.Invoke(); secondaryMenu.show(); hideRangeSlider(); }
private void changeMode(layouts layout) { // make toggle buttons using secondary menu switch of OnSecondaryMenuVisibility.Invoke(false); if (layout == layouts.EDIT) { layoutUI = layout; secondaryMenu.switchLayout(layout); if (mainController.getCurrentSelection() != null) { if (mainController.getCurrentSelection().GetComponent <SceneObject>().IsLight) { mainController.ActiveMode = MainController.Mode.lightMenuMode; } else { mainController.ActiveMode = MainController.Mode.objectMenuMode; } } } else if (layout == layouts.ANIMATION) { layoutUI = layout; secondaryMenu.switchLayout(layout); mainController.ActiveMode = MainController.Mode.animationEditing; } else if (layout == layouts.SCOUT) { layoutUI = layout; secondaryMenu.switchLayout(layout); mainController.ActiveMode = MainController.Mode.idle; } secondaryMenu.show(); }
//! //! adds a arbitrary gameobject to the menu which will displayed like buttons //! @param obj object to add //! public void addObject(GameObject obj, layouts layout = layouts.DEFAULT) { buttons.Add(obj); obj.SetActive(false); addObjectToLayout(obj, layout); }
public void drawSecondaryMenu(layouts layout) { secondaryMenu.switchLayout(layout); secondaryMenu.show(); }
public void addLayout(layouts layout) { layoutDict.Add(layout, new List <GameObject>()); }