Esempio n. 1
0
    void Start()
    {
        /* fsBlender is the fullscreen blender controls, which we show with Tab */
        fsBlender = ShowControls.CreateFullscreen(new[] {
            new ControlItem(descOrbit, MouseDirection.Both, MouseButton.MiddleClick),
            new ControlItem(descPan, KeyCode.LeftShift, MouseDirection.Both, MouseButton.MiddleClick),
            new ControlItem(descZoom, MouseButton.ScrollWheel),
            new ControlItem(descFocus, KeyCode.KeypadPeriod),
            new ControlItem(descPlay, new[] { KeyCode.LeftAlt, KeyCode.A }),
            new ControlItem(descFs, new[] { KeyCode.LeftShift, KeyCode.Space })
        });
        fsBlender.fullscreenTitle    = "Handy Blender Controls";
        fsBlender.fullscreenClearKey = blenderKey;

        /* fsUnity is the fullscreen unity controls, which we show with Z */
        fsUnity = ShowControls.CreateFullscreen(new[] {
            new ControlItem(descOrbit, KeyCode.LeftAlt, MouseDirection.Both, MouseButton.LeftClick),
            new ControlItem(descPan, KeyCode.LeftAlt, MouseDirection.Both, MouseButton.MiddleClick),
            new ControlItem(descZoom, KeyCode.LeftAlt, MouseDirection.Horizontal, MouseButton.RightClick),
            new ControlItem(descFocus, KeyCode.F),
            new ControlItem(descPlay, new[] { KeyCode.LeftControl, KeyCode.P }),
            new ControlItem(descFs, KeyCode.Space)
        });
        fsUnity.fullscreenTitle    = "Common controls for Unity";
        fsUnity.fullscreenClearKey = unityKey;

        /* fsTop is the top docked controls that always display, unless either
         * fullscreen display is showing. */
        fsTop = ShowControls.CreateDocked(new[] {
            new ControlItem("Show Blender controls", fsBlender.fullscreenClearKey),
            new ControlItem("Show Unity controls", fsUnity.fullscreenClearKey),
            new ControlItem("Create indefinite bottom dock", bottomPermKey),
            new ControlItem("Create temporary bottom dock", bottomTempKey)
        });
        fsTop.showDuration = -1;
        fsTop.size         = ShowControlSize.Small;
        fsTop.slideSpeed   = -1;
        fsTop.Show();

        /* the bottom controls are created now, but aren't displayed until
         * we press the proper key */
        bottomPerm = ShowControls.CreateDocked(new[] {
            new ControlItem(descBottomPerm, bottomPermKey)
        });
        bottomPerm.position = ShowControlPosition.Bottom;
        bottomPerm.hideLeftRightOnModifierKeys = false;
        bottomPerm.showDuration = -1;
    }
Esempio n. 2
0
    void Start()
    {
        startPoint = transform.position;
        cc         = GetComponent <CharacterController>();

        /* Create the fullscreen ShowControls with a control,
         * but don't show it yet. */
        fullscreen = ShowControls.CreateFullscreen(new ControlItem(moveFull, CustomDisplay.wasd));
        fullscreen.fullscreenMessageLeft  = "Mash ";
        fullscreen.fullscreenClearKey     = KeyCode.Tab;
        fullscreen.fullscreenMessageRight = "to keep rockin'";

        // make a ShowControls at the bottom to show movement &
        // the controls screen.  It stays around forever.
        bottomDock = ShowControls.CreateDocked(new[] {
            new ControlItem(movePopup, CustomDisplay.wasd),
            new ControlItem(menuPopup, KeyCode.Tab)
        });
        bottomDock.size         = ShowControlSize.Small;
        bottomDock.showDuration = -1;
        bottomDock.slideSpeed   = -1;
        bottomDock.position     = ShowControlPosition.Bottom;
        bottomDock.Show();
    }