Exemplo n.º 1
0
        //!
        //! Sets up all buttons for the main menu.
        //!
        private void setupMainMenu()
        {
            // views
            IMenuButton buttonPers = Elements.MenuButtonToggle();

            buttonPers.AddAction(GeneralMenu_Perspective_sel, GeneralMenu_Perspective_nrm, () => togglePerspectives());
            UI.OnUIChanged.AddListener(() => { buttonPers.Toggled = (secondaryMenu.currentLayout == layouts.PERSPECTIVES); });  // register for ui changes
            mainMenu.addButton(buttonPers);
            // info button
            //
            // modes
            IMenuButton buttonModes = Elements.MenuButtonList();

            buttonModes.AddAction(ModeMenu_EditMode_sel, ModeMenu_EditMode_nrm, () => changeMode(layouts.EDIT));
            buttonModes.AddAction(ModeMenu_AnimationMode_sel, ModeMenu_AnimationMode_nrm, () => changeMode(layouts.ANIMATION)); // anim
            buttonModes.AddAction(ModeMenu_ScoutMode_sel, ModeMenu_ScoutMode_nrm, () => changeMode(layouts.SCOUT));             //scout
            mainMenu.addButton(buttonModes);

            // gyro toggle
            IMenuButton buttonGyro = Elements.MenuButtonToggle();

            buttonGyro.AddAction(GeneralMenu_Gyro_sel, GeneralMenu_Gyro_nrm, () => mainController.toggleCameraRotation()); // for toggle
            buttonGyro.AddHoldAction(() => mainController.resetCameraOffset());
            mainMenu.addButton(buttonGyro);

            // config
            IMenuButton buttonConfig = Elements.MenuButtonToggle();

            buttonConfig.AddAction(GeneralMenu_Settings_sel, GeneralMenu_Settings_nrm, () => drawConfigWidget());
            buttonConfig.AddAction(GeneralMenu_Settings_sel, GeneralMenu_Settings_nrm, () => hideConfigWidget());       // untoggle action
            UI.OnUIChanged.AddListener(() => { buttonConfig.Toggled = (configWidget.gameObject.activeSelf == true); }); // register for ui changes
            mainMenu.addButton(buttonConfig);
            mainMenu.addButtonToLayout(buttonConfig, layouts.SPLASH);

            //help
            IMenuButton buttonHelp = Elements.MenuButton();

            buttonHelp.AddAction(GeneralMenu_Help_sel, GeneralMenu_Help_nrm, call: () => openHelp()); // switch off
            mainMenu.addButton(buttonHelp);
            mainMenu.addButtonToLayout(buttonHelp, layouts.SPLASH);
            // quit
            IMenuButton buttonQuit = Elements.MenuButton();

            buttonQuit.AddAction(GeneralMenu_OnOff_sel, GeneralMenu_OnOff_nrm, call: () => quitApplication());              // switch off
            mainMenu.addButton(buttonQuit);
            mainMenu.addButtonToLayout(buttonQuit, layouts.SPLASH);

            // set splash layout
            mainMenu.switchLayout(layouts.SPLASH);
        }
Exemplo n.º 2
0
        //!
        //! Sets up all buttons for the main menu.
        //!
        private void setupMainMenu()
        {
            // views
            IMenuButton buttonPers = Elements.MenuButtonToggle();

            buttonPers.AddAction(GeneralMenu_Perspective_sel, GeneralMenu_Perspective_nrm, () => secondaryMenuSwitchLayout(layouts.PERSPECTIVES));
            OnSecondaryMenuVisibility.AddListener(((MenuButtonToggle)buttonPers).setToggleState);               // register changes
            mainMenu.addButton(buttonPers);
            // info button
            //
            // modes
            IMenuButton buttonModes = Elements.MenuButtonList();

            buttonModes.AddAction(ModeMenu_EditMode_sel, ModeMenu_EditMode_nrm, () => changeMode(layouts.EDIT));
            buttonModes.AddAction(ModeMenu_AnimationMode_sel, ModeMenu_AnimationMode_nrm, () => changeMode(layouts.ANIMATION)); // anim
            buttonModes.AddAction(ModeMenu_ScoutMode_sel, ModeMenu_ScoutMode_nrm, () => changeMode(layouts.SCOUT));             //scout
            mainMenu.addButton(buttonModes);
            // gyro toggle
            IMenuButton buttonGyro = Elements.MenuButtonToggle();

            buttonGyro.AddAction(GeneralMenu_Gyro_sel, GeneralMenu_Gyro_nrm, () => mainController.toggleCameraRotation());              // for toggle
            buttonGyro.AddAction(GeneralMenu_Gyro_sel, GeneralMenu_Gyro_nrm, () => mainController.toggleCameraRotation());              // for untogle
            buttonGyro.AddHoldAction(() => mainController.resetCameraOffset());
            mainMenu.addButton(buttonGyro);
            // config
            IMenuButton buttonConfig = Elements.MenuButtonToggle();

            buttonConfig.AddAction(GeneralMenu_Settings_sel, GeneralMenu_Settings_nrm, () => drawConfigWidget());
            buttonConfig.AddAction(GeneralMenu_Settings_sel, GeneralMenu_Settings_nrm, () => hideConfigWidget());        // untoggle action
            configWidget.OnVisibilityChanged.AddListener(((MenuButtonToggle)buttonConfig).setToggleState);               // register changes (connect to config widget visibility)
            mainMenu.addButton(buttonConfig);
            mainMenu.addButtonToLayout(buttonConfig, layouts.SPLASH);
            // quit
            IMenuButton buttonQuit = Elements.MenuButton();

            buttonQuit.AddAction(GeneralMenu_OnOff_sel, GeneralMenu_OnOff_nrm, call: () => quitApplication());              // switch off
            mainMenu.addButton(buttonQuit);
            mainMenu.addButtonToLayout(buttonQuit, layouts.SPLASH);

            // set splash layout
            mainMenu.switchLayout(layouts.SPLASH);
        }
Exemplo n.º 3
0
        private void setupParameterMenu()
        {
            // transform
            IMenuButton buttonTransX = Elements.MenuButtonToggle();

            buttonTransX.AddAction(EditMode_AxisX_sel, EditMode_AxisX_nrm, () => parameterButtonHandle(buttonTransX, 0));
            IMenuButton buttonTransY = Elements.MenuButtonToggle();

            buttonTransY.AddAction(EditMode_AxisY_sel, EditMode_AxisY_nrm, () => parameterButtonHandle(buttonTransY, 1));
            IMenuButton buttonTransZ = Elements.MenuButtonToggle();

            buttonTransZ.AddAction(EditMode_AxisZ_sel, EditMode_AxisZ_nrm, () => parameterButtonHandle(buttonTransZ, 2));
            // light settings
            IMenuButton buttonLightIntensity = Elements.MenuButtonToggle();

            buttonLightIntensity.AddAction(EditMode_LightIntensity_sel, EditMode_LightIntensity_nrm, () => parameterButtonHandle(buttonLightIntensity, 0));
            IMenuButton buttonLightRange = Elements.MenuButtonToggle();

            buttonLightRange.AddAction(ScoutMode_FocalLength_sel, ScoutMode_FocalLength_nrm, () => parameterButtonHandle(buttonLightRange, 1));
            IMenuButton buttonLightAngle = Elements.MenuButtonToggle();

            buttonLightAngle.AddAction(EditMode_LightConeAngle_sel, EditMode_LightConeAngle_nrm, () => parameterButtonHandle(buttonLightAngle, 2));
            // attach to cam
            IMenuButton buttonAttachCam = Elements.MenuButtonToggle();

            buttonAttachCam.AddAction(EditMode_TranslateAttachToCam_sel, EditMode_TranslateAttachToCam_nrm, () => editLinkToCamera(buttonAttachCam)); //
            UI.OnUIChanged.AddListener(() => { buttonAttachCam.Toggled = (mainController.ActiveMode == MainController.Mode.objectLinkCamera); });     // register ui changes
            // click to move
            IMenuButton buttonClickMove = Elements.MenuButtonToggle();

            buttonClickMove.AddAction(EditMode_TranslateClickToMove_sel, EditMode_TranslateClickToMove_nrm, () => editPointToMove(buttonClickMove)); //
            UI.OnUIChanged.AddListener(() => { buttonClickMove.Toggled = (mainController.ActiveMode == MainController.Mode.pointToMoveMode); });     // register ui changes

            // TODO: add range
            // add buttons
            parameterMenu.DirToExpand = SubMenu.direction.BOTTOM;
            parameterMenu.addButton(buttonTransX, layouts.TRANSFORM);
            parameterMenu.addButton(buttonTransY, layouts.TRANSFORM);
            parameterMenu.addButton(buttonTransZ, layouts.TRANSFORM);
            parameterMenu.addButton(buttonTransX, layouts.TRANSLATION);
            parameterMenu.addButton(buttonTransY, layouts.TRANSLATION);
            parameterMenu.addButton(buttonTransZ, layouts.TRANSLATION);
            parameterMenu.addButton(buttonAttachCam, layouts.TRANSLATION);
            parameterMenu.addButton(buttonClickMove, layouts.TRANSLATION);
            parameterMenu.addButton(buttonLightIntensity, layouts.LIGHTDIR);
            parameterMenu.addButtonToLayout(buttonLightIntensity, layouts.LIGHTPOINT);
            parameterMenu.addButton(buttonLightRange, layouts.LIGHTPOINT);
            parameterMenu.addButtonToLayout(buttonLightIntensity, layouts.LIGHTSPOT);
            parameterMenu.addButtonToLayout(buttonLightRange, layouts.LIGHTSPOT);
            parameterMenu.addButton(buttonLightAngle, layouts.LIGHTSPOT);
        }
Exemplo n.º 4
0
        //!
        //! Sets up all buttons for the secondary menu.
        //!
        public void setupSecondaryMenu()
        {
            //empty menu
            secondaryMenu.clear();

            // add empty layout for edit mode
            secondaryMenu.addLayout(layouts.EDIT);

            // cam from snapshot
            IMenuButton buttonSnap = Elements.MenuButton();

            buttonSnap.AddAction(PerspectiveMenu_Snapshot_sel, PerspectiveMenu_Snapshot_nrm);
            secondaryMenu.addButton(buttonSnap, layouts.PERSPECTIVES);
            // top
            IMenuButton buttonTop = Elements.MenuButtonToggle();

            buttonTop.AddAction(PerspectiveMenu_OrthographicTop_sel, PerspectiveMenu_OrthographicTop_nrm, call: () => orthographicCamera(MainController.View.TOP));
            buttonTop.AddAction(PerspectiveMenu_OrthographicTop_sel, PerspectiveMenu_OrthographicTop_nrm, call: () => perspectiveCamera());
            secondaryMenu.addButton(buttonTop, layouts.PERSPECTIVES);
            // front
            IMenuButton buttonFront = Elements.MenuButtonToggle();

            buttonFront.AddAction(PerspectiveMenu_OrthographicFront_sel, PerspectiveMenu_OrthographicFront_nrm, call: () => orthographicCamera(MainController.View.FRONT));
            buttonFront.AddAction(PerspectiveMenu_OrthographicFront_sel, PerspectiveMenu_OrthographicFront_nrm, call: () => perspectiveCamera());
            secondaryMenu.addButton(buttonFront, layouts.PERSPECTIVES);
            // right
            IMenuButton buttonRight = Elements.MenuButtonToggle();

            buttonRight.AddAction(PerspectiveMenu_OrthographicRight_sel, PerspectiveMenu_OrthographicRight_nrm, call: () => orthographicCamera(MainController.View.RIGHT));
            buttonRight.AddAction(PerspectiveMenu_OrthographicRight_sel, PerspectiveMenu_OrthographicRight_nrm, call: () => perspectiveCamera());
            secondaryMenu.addButton(buttonRight, layouts.PERSPECTIVES);
            // left
            IMenuButton buttonLeft = Elements.MenuButtonToggle();

            buttonLeft.AddAction(PerspectiveMenu_OrthographicLeft_sel, PerspectiveMenu_OrthographicLeft_nrm, call: () => orthographicCamera(MainController.View.LEFT));
            buttonLeft.AddAction(PerspectiveMenu_OrthographicLeft_sel, PerspectiveMenu_OrthographicLeft_nrm, call: () => perspectiveCamera());
            secondaryMenu.addButton(buttonLeft, layouts.PERSPECTIVES);
            // bottom
            IMenuButton buttonBottom = Elements.MenuButtonToggle();

            buttonBottom.AddAction(PerspectiveMenu_OrthographicBottom_sel, PerspectiveMenu_OrthographicBottom_nrm, call: () => orthographicCamera(MainController.View.BOTTOM));
            buttonBottom.AddAction(PerspectiveMenu_OrthographicBottom_sel, PerspectiveMenu_OrthographicBottom_nrm, call: () => perspectiveCamera());
            secondaryMenu.addButton(buttonBottom, layouts.PERSPECTIVES);
            // ncam
            IMenuButton buttonNcam = Elements.MenuButtonToggle();

            buttonNcam.AddAction(PerspectiveMenu_PrincipalCam_sel, PerspectiveMenu_PrincipalCam_nrm, call: () => ncamCamera());
            secondaryMenu.addButton(buttonNcam, layouts.PERSPECTIVES);
            // predefined
            IMenuButton buttonPre = Elements.MenuButton();

            buttonPre.AddAction(PerspectiveMenu_External_sel, PerspectiveMenu_External_nrm, call: () => predefinedCamera());
            secondaryMenu.addButton(buttonPre, layouts.PERSPECTIVES);
            // scouting
            //// depth of field toggle
            //IMenuButton buttonDOF = Elements.MenuButtonToggle();
            //buttonDOF.AddAction(ScoutMode_DOF_sel, ScoutMode_DOF_nrm, call: () => mainController.toggleDOF()); // toggle DOF component
            //secondaryMenu.addButton(buttonDOF, layouts.SCOUT);
            //// focus visualizer toggle
            //IMenuButton buttonVisualize = Elements.MenuButtonToggle();
            //buttonVisualize.AddAction(ScoutMode_Visualizer_sel, ScoutMode_Visualizer_nrm, call: () => mainController.toggleVisualizer()); // toggle visualize focus
            //secondaryMenu.addButton(buttonVisualize, layouts.SCOUT);
            //// focus
            //IMenuButton buttonFocus = Elements.MenuButtonList();
            //buttonFocus.AddAction(ScoutMode_Focus_sel, ScoutMode_Focus_nrm, call: () => showCameraSlider(CameraObject.CameraParameter.FOCDIST)); // focal distance slider
            //buttonFocus.AddAction(ScoutMode_Focus_sel, ScoutMode_Focus_nrm, call: () => showCameraSlider(CameraObject.CameraParameter.FOCSIZE)); // focal size slider
            //secondaryMenu.addButton(buttonFocus, layouts.SCOUT);
            // field of view / lens
            //IMenuButton buttonFov;
            //if (!mainController.arMode)
            //{
            //    buttonFov = Elements.MenuButtonToggle();
            //    buttonFov.AddAction(ScoutMode_FocalLength_sel, ScoutMode_FocalLength_nrm, call: () => cameraFov(buttonFov)); // field of view slider
            //}
            //else
            //{
            //    buttonFov = Elements.MenuButton();
            //    buttonFov.AddAction(ScoutMode_FocalLength_sel, ScoutMode_FocalLength_nrm); // field of view slider
            //}
            //secondaryMenu.addButton(buttonFov, layouts.SCOUT);
            // aperture
            IMenuButton buttonApert = Elements.MenuButton();

            buttonApert.AddAction(ScoutMode_Aperture_sel, ScoutMode_Aperture_nrm); // aperture slider
            secondaryMenu.addButton(buttonApert, layouts.SCOUT);
            // cam settings
            IMenuButton buttonCam = Elements.MenuButton();

            buttonCam.AddAction(ScoutMode_CamSettings_sel, ScoutMode_CamSettings_nrm); //
            secondaryMenu.addButton(buttonCam, layouts.SCOUT);
            // path record
            IMenuButton buttonRec = Elements.MenuButton();

            buttonRec.AddAction(ScoutMode_PathRecord_sel, ScoutMode_PathRecord_nrm);             //
            secondaryMenu.addButton(buttonRec, layouts.SCOUT);
            // snapshot
            IMenuButton buttonScout = Elements.MenuButton();

            buttonScout.AddAction(ScoutMode_Snapshot_sel, ScoutMode_Snapshot_nrm);             // 15
            secondaryMenu.addButton(buttonScout, layouts.SCOUT);
            // click to move
            IMenuButton buttonClickMoveCam;

            if (!mainController.arMode)
            {
                buttonClickMoveCam = Elements.MenuButtonToggle();
                buttonClickMoveCam.AddAction(EditMode_TranslateClickToMove_sel, EditMode_TranslateClickToMove_nrm, call: () => pointToMoveCamera(buttonClickMoveCam)); //
                // UI.OnUIChanged.AddListener(() => { buttonClickMoveCam.Toggled = (mainController.ActiveMode == MainController.Mode.pointToMoveMode); } );  // register for ui changes
            }
            else
            {
                buttonClickMoveCam = Elements.MenuButton();
                buttonClickMoveCam.AddAction(EditMode_TranslateClickToMove_sel, EditMode_TranslateClickToMove_nrm); //
            }
            secondaryMenu.addButton(buttonClickMoveCam, layouts.SCOUT);
            // animation mode buttons
            // previous key
            IMenuButton buttonKeyPrev = Elements.MenuButton();

            buttonKeyPrev.AddAction(AnimationMode_JumpToPreviousKeyframe_sel, AnimationMode_JumpToPreviousKeyframe_nrm, call: () => mainController.AnimationController.previousKeyframe());              //
            secondaryMenu.addButton(buttonKeyPrev, layouts.ANIMATION);
            // add timeline //
            GameObject timeLine = GameObject.Find("GUI/Canvas/UI/TimeLine");

            if (timeLine == null)
            {
                Debug.LogError(string.Format("{0}: Cant Find TimeLine (GUI/Canvas/UI/TimeLine).", this.GetType()));
            }
            else
            {
                secondaryMenu.addObject(timeLine, layouts.ANIMATION);
            }
            // next key
            IMenuButton buttonKeyNext = Elements.MenuButton();

            buttonKeyNext.AddAction(AnimationMode_JumpToNextKeyframe_sel, AnimationMode_JumpToNextKeyframe_nrm, call: () => mainController.AnimationController.nextKeyframe());              //
            secondaryMenu.addButton(buttonKeyNext, layouts.ANIMATION);
            // play pause
            IMenuButton buttonPlay = Elements.MenuButtonToggle();

            buttonPlay.AddAction(AnimationMode_Pause_sel, AnimationMode_Play_nrm, () => mainController.AnimationController.togglePlayPause());
            secondaryMenu.addButton(buttonPlay, layouts.ANIMATION);
            // fire cue
            IMenuButton buttonPlayCue = Elements.MenuButtonToggle();

            //buttonPlayCue.AddAction(AnimationMode_CueFire_sel, AnimationMode_CueFire_nrm, () => mainController.AnimationController.playAnimationLayer()); // 20
            buttonPlayCue.AddAction(AnimationMode_CueFire_sel, AnimationMode_CueFire_nrm, () => animationFireCueMenu(buttonPlayCue));  // 20
            secondaryMenu.addButton(buttonPlayCue, layouts.ANIMATION);

            // translation mode buttons
            // 3dwidget
            //IMenuButton buttonTrans = Elements.MenuButtonToggle();
            //buttonTrans.AddAction(EditMode_Translate3DWidget_sel, EditMode_Translate3DWidget_nrm, () => editWidget3D(buttonTrans) ); //
            //secondaryMenu.addButton( buttonTrans, layouts.TRANSLATION);
            // attach to cam
            //IMenuButton buttonAttachCam = Elements.MenuButtonToggle();
            //buttonAttachCam.AddAction(EditMode_TranslateAttachToCam_sel, EditMode_TranslateAttachToCam_nrm,() => editLinkToCamera(buttonAttachCam)); //
            //UI.OnUIChanged.AddListener(() => { buttonAttachCam.Toggled = (mainController.ActiveMode == MainController.Mode.objectLinkCamera); }); // register ui changes
            //secondaryMenu.addButton( buttonAttachCam, layouts.TRANSLATION);
            // click to move
            //IMenuButton buttonClickMove = Elements.MenuButtonToggle();
            //buttonClickMove.AddAction(EditMode_TranslateClickToMove_sel, EditMode_TranslateClickToMove_nrm, () => editPointToMove(buttonClickMove) ); //
            //UI.OnUIChanged.AddListener(() => { buttonClickMove.Toggled = (mainController.ActiveMode == MainController.Mode.pointToMoveMode); }); // register ui changes
            //secondaryMenu.addButton( buttonClickMove, layouts.TRANSLATION);
        }
Exemplo n.º 5
0
        private void setupCenterMenu()
        {
            // translate
            IMenuButton buttonTrans = Elements.MenuButtonToggle();

            buttonTrans.AddAction(EditMode_Translate_sel, EditMode_Translate_nrm, () => editTranslation(buttonTrans));
            centerMenu.addButton(buttonTrans, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonTrans, layouts.LIGHT);
            centerMenu.addButtonToLayout(buttonTrans, layouts.LIGHT_AR);
            centerMenu.addButtonToLayout(buttonTrans, layouts.CAMERA);
            centerMenu.addButtonToLayout(buttonTrans, layouts.CAMERA_AR);

            // rotate
            IMenuButton buttonRot = Elements.MenuButtonToggle();

            buttonRot.AddAction(EditMode_Rotate_sel, EditMode_Rotate_nrm, () => editRotation(buttonRot));
            centerMenu.addButton(buttonRot, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonRot, layouts.LIGHT);
            centerMenu.addButtonToLayout(buttonRot, layouts.LIGHT_AR);
            centerMenu.addButtonToLayout(buttonRot, layouts.CAMERA);
            centerMenu.addButtonToLayout(buttonRot, layouts.CAMERA_AR);
            // scale
            IMenuButton buttonScl = Elements.MenuButtonToggle();

            buttonScl.AddAction(EditMode_Scale_sel, EditMode_Scale_nrm, () => editScale(buttonScl));
            centerMenu.addButton(buttonScl, layouts.OBJECT);
            // reset
            IMenuButton buttonReset = Elements.MenuButton();

            buttonReset.AddAction(EditMode_Reset_sel, EditMode_Reset_nrm, call: () => objectReset());
            centerMenu.addButton(buttonReset, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonReset, layouts.LIGHT);
            centerMenu.addButtonToLayout(buttonReset, layouts.CAMERA);
            centerMenu.addButtonToLayout(buttonReset, layouts.LIGHT_AR);
            centerMenu.addButtonToLayout(buttonReset, layouts.CAMERA_AR);
            // gravity/kinematic on off
            IMenuButton buttonKin = Elements.MenuButtonToggle();

            buttonKin.AddAction(EditMode_GravityOn_sel, EditMode_GravityOn_nrm, () => mainController.toggleLockSelectionKinematic());
            UI.OnUIChanged.AddListener(() => { buttonKin.Toggled = mainController.HasGravityOn(); });        // register for ui changes
            centerMenu.OnMenuOpen.AddListener(() => { buttonKin.Toggled = mainController.HasGravityOn(); }); // register for ui changes
            centerMenu.addButton(buttonKin, layouts.OBJECT);
            // light color
            //IMenuButton buttonLightCol = Elements.MenuButtonToggle();
            //buttonLightCol.AddAction(EditMode_LightColour_sel, EditMode_LightColour_nrm, () => editLightColor(buttonLightCol));
            //centerMenu.addButton(buttonLightCol, layouts.LIGHT);
            //centerMenu.addButton(buttonLightCol, layouts.LIGHT_AR);
            // light settings
            IMenuButton buttonLightSet = Elements.MenuButtonToggle();

            buttonLightSet.AddAction(EditMode_LightSettings_sel, EditMode_LightSettings_nrm, () => editLightSettings(buttonLightSet));
            centerMenu.addButton(buttonLightSet, layouts.LIGHT);
            centerMenu.addButton(buttonLightSet, layouts.LIGHT_AR);
            // light look through
            IMenuButton buttonLookLight = Elements.MenuButtonToggle();

            buttonLookLight.AddAction(GeneralMenu_Perspective_sel, GeneralMenu_Perspective_nrm, call: () => lookThroughLight(buttonLookLight));
            centerMenu.addButton(buttonLookLight, layouts.LIGHT);

            /*
             * // angle
             * IMenuButton buttonLightAng = Elements.MenuButtonToggle();
             *          buttonLightAng.AddAction(EditMode_LightConeAngle_sel, EditMode_LightConeAngle_nrm, () => editLightAngle(buttonLightAng));
             *          centerMenu.addButton( buttonLightAng, layouts.LIGHTSPOT );
             *          // intensity
             *          IMenuButton buttonLightInt = Elements.MenuButtonToggle();
             *          buttonLightInt.AddAction(EditMode_LightIntensity_sel, EditMode_LightIntensity_nrm, () => editLightIntensity(buttonLightInt));
             *          centerMenu.addButton( buttonLightInt, layouts.LIGHTDIR );
             *          centerMenu.addButtonToLayout( buttonLightInt, layouts.LIGHTSPOT );
             *          centerMenu.addButtonToLayout( buttonLightInt, layouts.LIGHTPOINT );
             */
            // cue add
            IMenuButton buttonAniCueAdd = Elements.MenuButton();

            ((Button)buttonAniCueAdd).name = "AddCueMenu";
            buttonAniCueAdd.AddAction(AnimationMode_CueAdd_sel, AnimationMode_CueAdd_nrm, () => animationAddCueMenu(buttonAniCueAdd));
            centerMenu.addButton(buttonAniCueAdd, layouts.ANIMATION);
            // cue remove
            //IMenuButton buttonAniCueRem = Elements.MenuButton();
            //buttonAniCueRem.AddAction(AnimationMode_CueDelete_sel, AnimationMode_CueDelete_nrm); // 10
            //centerMenu.addButton( buttonAniCueRem, layouts.ANIMATION );
            // translate
            buttonTrans.AddAction(EditMode_Translate_sel, EditMode_Translate_nrm, () => editTranslation(buttonTrans));
            centerMenu.addButtonToLayout(buttonTrans, layouts.ANIMATION);
            // rotate
            buttonRot.AddAction(EditMode_Rotate_sel, EditMode_Rotate_nrm, () => editRotation(buttonRot));
            centerMenu.addButtonToLayout(buttonRot, layouts.ANIMATION);
            // scale
            centerMenu.addButtonToLayout(buttonScl, layouts.ANIMATION);
            // edit animation
            //IMenuButton buttonAniEdi = Elements.MenuButtonToggle();
            //buttonAniEdi.AddAction(AnimationMode_KeyframeTranslate_sel, AnimationMode_KeyframeTranslate_nrm, () => editAnimation(buttonAniEdi));
            //centerMenu.addButton(buttonAniEdi, layouts.ANIMATION);
            // delete animation
            IMenuButton buttonAniRem = Elements.MenuButton();

            buttonAniRem.AddAction(AnimationMode_DeleteKeyframe_sel, AnimationMode_DeleteKeyframe_nrm, call: () => animationDelete());
            centerMenu.addButton(buttonAniRem, layouts.ANIMATION);
            // camera look through
            IMenuButton buttonLookCamera = Elements.MenuButtonToggle();

            buttonLookCamera.AddAction(GeneralMenu_Perspective_sel, GeneralMenu_Perspective_nrm, call: () => lookThroughCamera(buttonLookCamera));
            centerMenu.addButton(buttonLookCamera, layouts.CAMERA);
            centerMenu.addButton(buttonLookCamera, layouts.CAMERALOCKED);
            // camera field of view
            IMenuButton buttonCameraFOV = Elements.MenuButtonToggle();

            buttonCameraFOV.AddAction(ScoutMode_FocalLength_sel, ScoutMode_FocalLength_nrm, call: () => cameraFOV(buttonCameraFOV));
            centerMenu.addButton(buttonCameraFOV, layouts.CAMERA);
            centerMenu.addButton(buttonCameraFOV, layouts.CAMERA_AR);
        }
Exemplo n.º 6
0
        private void setupCenterMenu()
        {
            // translate
            IMenuButton buttonTrans = Elements.MenuButtonToggle();

            buttonTrans.AddAction(EditMode_Translate_sel, EditMode_Translate_nrm, () => editTranslation(buttonTrans));
            centerMenu.addButton(buttonTrans, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonTrans, layouts.LIGHTDIR);
            centerMenu.addButtonToLayout(buttonTrans, layouts.LIGHTSPOT);
            centerMenu.addButtonToLayout(buttonTrans, layouts.LIGHTPOINT);
            // rotate
            IMenuButton buttonRot = Elements.MenuButtonToggle();

            buttonRot.AddAction(EditMode_Rotate_sel, EditMode_Rotate_nrm, () => editRotation(buttonRot));
            centerMenu.addButton(buttonRot, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonRot, layouts.LIGHTDIR);
            centerMenu.addButtonToLayout(buttonRot, layouts.LIGHTSPOT);
            // scale
            IMenuButton buttonScl = Elements.MenuButtonToggle();

            buttonScl.AddAction(EditMode_Scale_sel, EditMode_Scale_nrm, () => editScale(buttonScl));
            centerMenu.addButton(buttonScl, layouts.OBJECT);
            // reset
            IMenuButton buttonReset = Elements.MenuButton();

            buttonReset.AddAction(EditMode_Reset_sel, EditMode_Reset_nrm, call: () => objectReset());
            centerMenu.addButton(buttonReset, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonReset, layouts.LIGHTDIR);
            centerMenu.addButtonToLayout(buttonReset, layouts.LIGHTSPOT);
            centerMenu.addButtonToLayout(buttonReset, layouts.LIGHTPOINT);
            // graviy/kinematic on off
            IMenuButton buttonKin = Elements.MenuButtonToggle();

            buttonKin.AddAction(EditMode_GravityOn_sel, EditMode_GravityOn_nrm, () => mainController.toggleLockSelectionKinematic());
            mainController.OnObjectGravityChange.AddListener(((MenuButtonToggle)buttonKin).setToggleState);               // register changes ( updatet button state when gravity set on/off )
            centerMenu.addButton(buttonKin, layouts.OBJECT);
            // light color
            IMenuButton buttonLightCol = Elements.MenuButtonToggle();

            buttonLightCol.AddAction(EditMode_LightColour_sel, EditMode_LightColour_nrm, () => editLightColor(buttonLightCol)); //
            centerMenu.addButton(buttonLightCol, layouts.LIGHTDIR);
            centerMenu.addButtonToLayout(buttonLightCol, layouts.LIGHTSPOT);
            centerMenu.addButtonToLayout(buttonLightCol, layouts.LIGHTPOINT);
            // angle
            IMenuButton buttonLightAng = Elements.MenuButtonToggle();

            buttonLightAng.AddAction(EditMode_LightConeAngle_sel, EditMode_LightConeAngle_nrm, () => editLightAngle(buttonLightAng));
            centerMenu.addButton(buttonLightAng, layouts.LIGHTSPOT);
            // intensity
            IMenuButton buttonLightInt = Elements.MenuButtonToggle();

            buttonLightInt.AddAction(EditMode_LightIntensity_sel, EditMode_LightIntensity_nrm, () => editLightIntensity(buttonLightInt));
            centerMenu.addButton(buttonLightInt, layouts.LIGHTDIR);
            centerMenu.addButtonToLayout(buttonLightInt, layouts.LIGHTSPOT);
            centerMenu.addButtonToLayout(buttonLightInt, layouts.LIGHTPOINT);
            // cue add
            IMenuButton buttonAniCueAdd = Elements.MenuButton();

            buttonAniCueAdd.AddAction(AnimationMode_CueAdd_sel, AnimationMode_CueAdd_nrm, () => animationAddCueMenu(buttonAniCueAdd));
            centerMenu.addButton(buttonAniCueAdd, layouts.ANIMATION);
            // cue remove
            IMenuButton buttonAniCueRem = Elements.MenuButton();

            buttonAniCueRem.AddAction(AnimationMode_CueDelete_sel, AnimationMode_CueDelete_nrm);             // 10
            centerMenu.addButton(buttonAniCueRem, layouts.ANIMATION);
            // edit animation
            IMenuButton buttonAniEdi = Elements.MenuButtonToggle();

            buttonAniEdi.AddAction(AnimationMode_KeyframeTranslate_sel, AnimationMode_KeyframeTranslate_nrm, () => editAnimation(buttonAniEdi));
            centerMenu.addButton(buttonAniEdi, layouts.ANIMATION);
            // delete animation
            IMenuButton buttonAniRem = Elements.MenuButton();

            buttonAniRem.AddAction(AnimationMode_DeleteKeyframe_sel, AnimationMode_DeleteKeyframe_nrm, call: () => animationDelete());
            centerMenu.addButton(buttonAniRem, layouts.ANIMATION);
        }
Exemplo n.º 7
0
        private void setupCenterMenu()
        {
            // translate
            IMenuButton buttonTrans = Elements.MenuButtonToggle();

            buttonTrans.AddAction(EditMode_Translate_sel, EditMode_Translate_nrm, () => editTranslation(buttonTrans));
            centerMenu.addButton(buttonTrans, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonTrans, layouts.LIGHT);

            /*
             * centerMenu.addButtonToLayout(buttonTrans, layouts.LIGHTDIR);
             * centerMenu.addButtonToLayout(buttonTrans, layouts.LIGHTSPOT);
             * centerMenu.addButtonToLayout(buttonTrans, layouts.LIGHTPOINT);
             */
            // rotate
            IMenuButton buttonRot = Elements.MenuButtonToggle();

            buttonRot.AddAction(EditMode_Rotate_sel, EditMode_Rotate_nrm, () => editRotation(buttonRot));
            UI.OnUIChanged.AddListener(() => { buttonRot.Toggled = mainController.ActiveMode == MainController.Mode.rotationMode; });
            centerMenu.addButton(buttonRot, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonRot, layouts.LIGHT);

            /*
             * centerMenu.addButtonToLayout(buttonRot, layouts.LIGHTDIR);
             * centerMenu.addButtonToLayout(buttonRot, layouts.LIGHTSPOT);
             */
            // scale
            IMenuButton buttonScl = Elements.MenuButtonToggle();

            buttonScl.AddAction(EditMode_Scale_sel, EditMode_Scale_nrm, () => editScale(buttonScl));
            centerMenu.addButton(buttonScl, layouts.OBJECT);
            // reset
            IMenuButton buttonReset = Elements.MenuButton();

            buttonReset.AddAction(EditMode_Reset_sel, EditMode_Reset_nrm, call: () => objectReset());
            centerMenu.addButton(buttonReset, layouts.OBJECT);
            centerMenu.addButtonToLayout(buttonReset, layouts.LIGHT);

            /*
             * centerMenu.addButtonToLayout( buttonReset, layouts.LIGHTDIR );
             *          centerMenu.addButtonToLayout( buttonReset, layouts.LIGHTSPOT );
             *          centerMenu.addButtonToLayout( buttonReset, layouts.LIGHTPOINT );
             */
            // graviy/kinematic on off
            IMenuButton buttonKin = Elements.MenuButtonToggle();

            buttonKin.AddAction(EditMode_GravityOn_sel, EditMode_GravityOn_nrm, () => mainController.toggleLockSelectionKinematic());
            UI.OnUIChanged.AddListener(() => { buttonKin.Toggled = mainController.HasGravityOn(); });        // register for ui changes
            centerMenu.OnMenuOpen.AddListener(() => { buttonKin.Toggled = mainController.HasGravityOn(); }); // register for ui changes
            centerMenu.addButton(buttonKin, layouts.OBJECT);
            // light color
            IMenuButton buttonLightCol = Elements.MenuButtonToggle();

            buttonLightCol.AddAction(EditMode_LightColour_sel, EditMode_LightColour_nrm, () => editLightColor(buttonLightCol)); //
            centerMenu.addButton(buttonLightCol, layouts.LIGHT);

            /*
             * centerMenu.addButton(buttonLightCol, layouts.LIGHTDIR);
             * centerMenu.addButtonToLayout(buttonLightCol, layouts.LIGHTSPOT);
             * centerMenu.addButtonToLayout(buttonLightCol, layouts.LIGHTPOINT);
             */
            // light settings
            IMenuButton buttonLightSet = Elements.MenuButtonToggle();

            buttonLightSet.AddAction(EditMode_LightSettings_sel, EditMode_LightSettings_nrm, () => editLightAngle(buttonLightSet));
            centerMenu.addButton(buttonLightSet, layouts.LIGHT);

            /*
             * // angle
             * IMenuButton buttonLightAng = Elements.MenuButtonToggle();
             *          buttonLightAng.AddAction(EditMode_LightConeAngle_sel, EditMode_LightConeAngle_nrm, () => editLightAngle(buttonLightAng));
             *          centerMenu.addButton( buttonLightAng, layouts.LIGHTSPOT );
             *          // intensity
             *          IMenuButton buttonLightInt = Elements.MenuButtonToggle();
             *          buttonLightInt.AddAction(EditMode_LightIntensity_sel, EditMode_LightIntensity_nrm, () => editLightIntensity(buttonLightInt));
             *          centerMenu.addButton( buttonLightInt, layouts.LIGHTDIR );
             *          centerMenu.addButtonToLayout( buttonLightInt, layouts.LIGHTSPOT );
             *          centerMenu.addButtonToLayout( buttonLightInt, layouts.LIGHTPOINT );
             */
            // cue add
            IMenuButton buttonAniCueAdd = Elements.MenuButton();

            ((Button)buttonAniCueAdd).name = "AddCueMenu";
            buttonAniCueAdd.AddAction(AnimationMode_CueAdd_sel, AnimationMode_CueAdd_nrm, () => animationAddCueMenu(buttonAniCueAdd));
            centerMenu.addButton(buttonAniCueAdd, layouts.ANIMATION);
            // cue remove
            //IMenuButton buttonAniCueRem = Elements.MenuButton();
            //buttonAniCueRem.AddAction(AnimationMode_CueDelete_sel, AnimationMode_CueDelete_nrm); // 10
            //centerMenu.addButton( buttonAniCueRem, layouts.ANIMATION );
            // translate
            buttonTrans.AddAction(EditMode_Translate_sel, EditMode_Translate_nrm, () => editTranslation(buttonTrans));
            centerMenu.addButtonToLayout(buttonTrans, layouts.ANIMATION);
            // rotate
            buttonRot.AddAction(EditMode_Rotate_sel, EditMode_Rotate_nrm, () => editRotation(buttonRot));
            centerMenu.addButtonToLayout(buttonRot, layouts.ANIMATION);
            // scale
            centerMenu.addButtonToLayout(buttonScl, layouts.ANIMATION);
            // edit animation
            //IMenuButton buttonAniEdi = Elements.MenuButtonToggle();
            //buttonAniEdi.AddAction(AnimationMode_KeyframeTranslate_sel, AnimationMode_KeyframeTranslate_nrm, () => editAnimation(buttonAniEdi));
            //centerMenu.addButton(buttonAniEdi, layouts.ANIMATION);
            // delete animation
            IMenuButton buttonAniRem = Elements.MenuButton();

            buttonAniRem.AddAction(AnimationMode_DeleteKeyframe_sel, AnimationMode_DeleteKeyframe_nrm, call: () => animationDelete());
            centerMenu.addButton(buttonAniRem, layouts.ANIMATION);
        }
Exemplo n.º 8
0
        //!
        //! Use this for initialization
        //!
        void Start()
        {
            arKeyVideoPlane = GameObject.Find("GUI/Canvas/ARVideoPlane");

            try
            {
                //cache reference to main Controller
                mainController = GameObject.Find("MainController").GetComponent <MainController>();


                //cache reference to animation Controller
                animationController = GameObject.Find("AnimationController").GetComponent <AnimationController>();
            }
            catch
            {
                print("Fix Me");
            }


            // get range slider
            rangeSlider = canvas.GetComponentInChildren <RangeSlider>(true);
            if (rangeSlider == null)
            {
                Debug.LogError(string.Format("{0}: Cant Find Component in Canvas: RangeSlider.", this.GetType()));
            }
            rangeSlider.OnValueChanged.AddListener(onRangeSliderChanged);

            // get light settings widget
            lightSettingsWidget = canvas.GetComponentInChildren <LightSettingsWidget>(true);
            if (lightSettingsWidget == null)
            {
                Debug.LogError(string.Format("{0}: Cant Find Component in Canvas: LightSettingsWidget.", this.GetType()));
            }


            //initalize main Menu
            GameObject mainMenuObject = new GameObject("mainMenuObject");

            mainMenuObject.transform.SetParent(this.transform.parent, false);
            mainMenu = mainMenuObject.AddComponent <MainMenu>();

            //initalize secondary Menu
            GameObject secondaryMenuObj = new GameObject("secondaryMenuObject");

            secondaryMenuObj.transform.SetParent(this.transform, false);
            secondaryMenu = secondaryMenuObj.AddComponent <SecondaryMenu>();

            //initalize center Menu
            GameObject centerMenuObj = new GameObject("centerMenuObject");

            centerMenuObj.transform.SetParent(this.transform, false);
            centerMenu = centerMenuObj.AddComponent <CenterMenu>();

            helpContext = GameObject.Find("GUI/Canvas/HelpScreen");

            //initalize paramter Menu
            GameObject paramterMenuObj = new GameObject("paramterMenuObj");

            paramterMenuObj.transform.SetParent(this.transform, false);
            parameterMenu = paramterMenuObj.AddComponent <SubMenu>();

            //store scene scale lable reference
            scaleLable = GameObject.Find("GUI/Canvas/ARConfigWidget/scale_value").GetComponent <Text>();

            // initalize ConfigWidget
            GameObject refObject = GameObject.Find("GUI/Canvas/ConfigWidget");

            if (refObject == null)
            {
                Debug.LogWarning(string.Format("{0}: No GUI/Canvas/ConfigWidget Object found. Load From Resource.", this.GetType()));
                GameObject refObjectPrefab = Resources.Load <GameObject>("VPET/Prefabs/ConfigWidget");
                refObject      = Instantiate(refObjectPrefab);
                refObject.name = refObjectPrefab.name;
                GameObject refParent = GameObject.Find("GUI/Canvas");
                refObject.transform.SetParent(refParent.transform, false);
            }
            configWidget = refObject.GetComponent <ConfigWidget>();
            if (configWidget == null)
            {
                Debug.LogWarning(string.Format("{0}: No ConfigWidget Component found. Create", this.GetType()));
                configWidget = refObject.AddComponent <ConfigWidget>();
            }
            // Submit listener
            configWidget.SubmitEvent.AddListener(mainController.configWidgetSubmit);
            // Ambient light listener
            configWidget.AmbientChangedEvent.AddListener(mainController.setAmbientIntensity);

#if USE_AR
            configWidget.ToggleAREvent.AddListener(mainController.ToggleArMode);
            // ar key connects
            configWidget.KeyDepthChangedEvent.AddListener(mainController.setARKeyDepth);
            configWidget.KeyColorChangedEvent.AddListener(mainController.setARKeyColor);
            configWidget.KeyRadiusChangedEvent.AddListener(mainController.setARKeyRadius);
            configWidget.KeyThresholdChangedEvent.AddListener(mainController.setARKeyThreshold);
            configWidget.ToggleARMatteEvent.AddListener(mainController.ToggleARMatteMode);
            configWidget.ToggleARKeyEvent.AddListener(mainController.ToggleARKeyMode);
            // add other ar managers here or change a global variable like VPET.Settings.sceneScale!
#endif


            //initalise mainMenu button
            IMenuButton iMainMenuButton = Elements.MenuButtonToggle();
            mainMenuButton      = ((Button)iMainMenuButton).gameObject;
            mainMenuButton.name = "MainMenuButton";
            mainMenuButton.transform.SetParent(this.transform.parent, false);
            mainMenuButton.GetComponent <RectTransform>().localPosition = new Vector2(VPETSettings.Instance.canvasHalfWidth - UI.ButtonOffset, (VPETSettings.Instance.canvasHalfHeight - UI.ButtonOffset) * VPETSettings.Instance.canvasAspectScaleFactor);
            iMainMenuButton.AddAction(GeneralMenu_Main_sel, GeneralMenu_Main_nrm, () => mainMenuToggle());
            mainMenuButton.SetActive(false);
            iMainMenuButton.Menu = mainMenu;

            //call setup function for all available menues
            setupMainMenu();
            setupSecondaryMenu();
            setupCenterMenu();
            setupParameterMenu();
        }
Exemplo n.º 9
0
        //!
        //! Use this for initialization
        //!
        void Start()
        {
            try
            {
                //cache reference to main Controller
                mainController = GameObject.Find("MainController").GetComponent <MainController>();


                //cache reference to animation Controller
                animationController = GameObject.Find("AnimationController").GetComponent <AnimationController>();

#if USE_TANGO
                //cache reference to tango Controller
                tangoController = GameObject.Find("Tango").GetComponent <TangoController>();
#endif
            }
            catch
            {
                print("Fix Me");
            }

            // initialize light settings widget
            GameObject ciLightSettingsObject = new GameObject("ciLightSettingsObject");
            ciLightSettingsObject.AddComponent <RectTransform>();
            ciLightSettingsObject.transform.SetParent(canvas, false);
            // ciLightSettingsObject.transform.localPosition = new Vector3(0, -canvasHeight/2+UI.ButtonOffset, 0);
            lightSettingsWidget = ciLightSettingsObject.AddComponent <LightSettingsWidget>();

            //initalize main Menu
            GameObject mainMenuObject = new GameObject("mainMenuObject");
            mainMenuObject.transform.SetParent(this.transform, false);
            mainMenu = mainMenuObject.AddComponent <MainMenu>();

            //initalize secondary Menu
            GameObject secondaryMenuObj = new GameObject("secondaryMenuObject");
            secondaryMenuObj.transform.SetParent(this.transform, false);
            secondaryMenu = secondaryMenuObj.AddComponent <SecondaryMenu>();

            //initalize center Menu
            GameObject centerMenuObj = new GameObject("centerMenuObject");
            centerMenuObj.transform.SetParent(this.transform, false);
            centerMenu = centerMenuObj.AddComponent <CenterMenu>();

            // initalize ConfigWidget
            GameObject refObject = GameObject.Find("GUI/Canvas/ConfigWidget");
            if (refObject == null)
            {
                Debug.LogWarning(string.Format("{0}: No GUI/Canvas/ConfigWidget Object found. Load From Resource.", this.GetType()));
                GameObject refObjectPrefab = Resources.Load <GameObject>("VPET/Prefabs/ConfigWidget");
                refObject      = Instantiate(refObjectPrefab);
                refObject.name = refObjectPrefab.name;
                GameObject refParent = GameObject.Find("GUI/Canvas");
                refObject.transform.SetParent(refParent.transform, false);
            }
            configWidget = refObject.GetComponent <ConfigWidget>();
            if (configWidget == null)
            {
                Debug.LogWarning(string.Format("{0}: No ConfigWidget Component found. Create", this.GetType()));
                configWidget = refObject.AddComponent <ConfigWidget>();
            }
            // Submit listener
            configWidget.SubmitEvent.AddListener(mainController.configWidgetSubmit);
            // Ambient light listener
            configWidget.AmbientChangedEvent.AddListener(mainController.setAmbientIntensity);

#if USE_TANGO
            // Show Tango Scale UI objects
            GameObject tangoScaleSliderUI = GameObject.Find("GUI/Canvas/ConfigWidget/TangoScale_slider");
            // tangoScaleSliderUI.transform.localPosition = new Vector3(31.0f, -560.0f, 0.0f);
            GameObject tangoScaleLabelUI = GameObject.Find("GUI/Canvas/ConfigWidget/TangoScale_label");
            //tangoScaleLabelUI.transform.localPosition = new Vector3(-105.0f, 530.0f, 0.0f);
            GameObject startButton = GameObject.Find("GUI/Canvas/ConfigWidget/Start_button");
            startButton.transform.localPosition = new Vector3(0f, -670f, 0.0f);
            GameObject sliderValueText = GameObject.Find("GUI/Canvas/ConfigWidget/TangoScale_Value");
            sliderValueText.gameObject.SetActive(true);
            tangoScaleLabelUI.gameObject.SetActive(true);
            tangoScaleSliderUI.gameObject.SetActive(true);
            // Tango Scale Listener
            configWidget.TangoScaleChangedEvent.AddListener(tangoController.setTangoScaleIntensity);
#endif


            /*
             * //initalize undo buttons
             * undoButton = Instantiate(GameObject.Find("ButtonTemplate"));
             * undoButton.transform.SetParent(this.transform,false);
             * //undoButton.GetComponent<RectTransform>().sizeDelta = SpriteSize;
             * undoButton.GetComponent<RectTransform>().position = new Vector2(Screen.height / 16 + 10, ((Screen.height / 3) * 2) - (Screen.height / 8 + 10));
             * undoButton.GetComponent<Image>().sprite =   GeneralMenu_Undo_nrm;
             * SpriteState undoSprites = new SpriteState();
             * undoSprites.disabledSprite = GeneralMenu_Undo_nrm;
             * undoSprites.highlightedSprite = GeneralMenu_Undo_nrm;
             * undoSprites.pressedSprite = GeneralMenu_Undo_sel;
             * undoButton.GetComponent<Button>().spriteState = undoSprites;
             * undoButton.GetComponent<Button>().interactable = false;
             * undoButton.GetComponent<Button>().onClick.AddListener(() => undoButtonClicked());
             * // temp hide it
             * undoButton.GetComponent<Image>().enabled = false;
             *
             * //initalize redo buttons
             * redoButton = Instantiate(GameObject.Find("ButtonTemplate"));
             * redoButton.transform.SetParent(this.transform, false);
             * //redoButton.GetComponent<RectTransform>().sizeDelta = SpriteSize;
             * redoButton.GetComponent<RectTransform>().position = new Vector2(Screen.width - (Screen.height / 16 + 10), ((Screen.height / 3) * 2) - (Screen.height / 8 + 10));
             * redoButton.GetComponent<Image>().sprite = GeneralMenu_Redo_nrm;
             * SpriteState redoSprites = new SpriteState();
             * redoSprites.disabledSprite = GeneralMenu_Redo_nrm;
             * redoSprites.highlightedSprite = GeneralMenu_Redo_nrm;
             * redoSprites.pressedSprite = GeneralMenu_Redo_sel;
             * redoButton.GetComponent<Button>().spriteState = redoSprites;
             * redoButton.GetComponent<Button>().interactable = false;
             * redoButton.GetComponent<Button>().onClick.AddListener(() => redoButtonClicked());
             * // temp hide it
             * redoButton.GetComponent<Image>().enabled = false;
             */

            //initalise mainMenu button
            IMenuButton iMainMenuButton = Elements.MenuButtonToggle();
            mainMenuButton      = ((Button)iMainMenuButton).gameObject;
            mainMenuButton.name = "MainMenuButton";
            mainMenuButton.transform.SetParent(this.transform, false);
            mainMenuButton.GetComponent <RectTransform>().localPosition = new Vector2(VPETSettings.Instance.canvasHalfWidth - UI.ButtonOffset, (VPETSettings.Instance.canvasHalfHeight - UI.ButtonOffset) * VPETSettings.Instance.canvasAspectScaleFactor);
            iMainMenuButton.AddAction(GeneralMenu_Main_sel, GeneralMenu_Main_nrm, () => mainMenuToggle());
            mainMenuButton.SetActive(false);
            iMainMenuButton.Menu = mainMenu;



            //call setup function for all available menues
            setupMainMenu();
            setupSecondaryMenu();
            setupCenterMenu();

            // initialize camera slider widget
            setupCameraSlider();
        }