Ejemplo n.º 1
0
 public void drawCenterMenu(layouts layout)
 {
     centerMenu.reset();
     centerMenu.switchLayout(layout);
     UI.OnUIChanged.Invoke();
     centerMenu.show();
 }
Ejemplo n.º 2
0
        public void switchLayoutMainMenu(layouts lay)
        {
            mainMenu.switchLayout(layouts.DEFAULT);

            // HACK
            mainMenuButton.GetComponent <MenuButtonToggle>().Toggled = false;
        }
Ejemplo n.º 3
0
        public void addButtonToLayout(IMenuButton newButton, layouts layout)
        {
            if (!layoutDict.ContainsKey(layout))
            {
                layoutDict.Add(layout, new List <GameObject>());
            }

            layoutDict[layout].Add(((Button)newButton).gameObject);
        }
Ejemplo n.º 4
0
        public void addObjectToLayout(GameObject newObj, layouts layout)
        {
            if (!layoutDict.ContainsKey(layout))
            {
                layoutDict.Add(layout, new List <GameObject>());
            }

            layoutDict[layout].Add(newObj);
        }
Ejemplo n.º 5
0
        //!
        //! 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;
        }
Ejemplo n.º 6
0
 //!
 //! 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;
 }
Ejemplo n.º 7
0
        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();
        }
Ejemplo n.º 8
0
 private void secondaryMenuSwitchLayout(layouts lay)
 {
     if (secondaryMenu.currentLayout == lay)
     {
         secondaryMenu.switchLayout(layouts.DEFAULT);
     }
     else
     {
         secondaryMenu.switchLayout(lay);
     }
     secondaryMenu.show();
 }
Ejemplo n.º 9
0
        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();
        }
Ejemplo n.º 10
0
        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();
        }
Ejemplo n.º 11
0
        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();
            }
        }
Ejemplo n.º 12
0
 //!
 //! 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;
 }
Ejemplo n.º 13
0
        //!
        //! 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);
                }
            }
        }
Ejemplo n.º 14
0
        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();
        }
Ejemplo n.º 15
0
        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();
        }
Ejemplo n.º 16
0
 //!
 //! 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);
 }
Ejemplo n.º 17
0
 public void drawSecondaryMenu(layouts layout)
 {
     secondaryMenu.switchLayout(layout);
     secondaryMenu.show();
 }
Ejemplo n.º 18
0
 public void addLayout(layouts layout)
 {
     layoutDict.Add(layout, new List <GameObject>());
 }