Пример #1
0
 void AddPowerup(string powerup)
 {
     // create a new docked ShowControls, and also add the control
     // to the fullscreen list.
     switch (powerup) {
         case "Jump":
             hasJump = true;
             fullscreen.controls.Add(
                 new ControlItem(jumpFull, KeyCode.Space));
             // create the "jump" dock.  We don't need to keep track of the
             // ShowControls it returns, as it will take care of itself
             // when the duration runs out.  Create it, & immediately
             // show it.
             ShowControls.CreateDocked(
                 new ControlItem(jumpPopup, KeyCode.Space)).Show();
             break;
         case "Die":
             hasDie = true;
             fullscreen.controls.Add(
                 new ControlItem(dieFull, MouseButton.LeftClick));
             // Create the "die" dock.  We don't show it immediately
             // because we want to adjust the duration before showing.
             dieDock = ShowControls.CreateDocked(
                 new ControlItem(diePopup, MouseButton.LeftClick));
             dieDock.showDuration = -1;
             dieDock.Show();
             break;
     }
 }
Пример #2
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         ShowControls sc = ShowControls.CreateDocked(new ControlItem("An example of showing controls for a single key", KeyCode.Space));
         sc.destroyWhenDone = true;
         sc.Show();
     }
     if (Input.GetKeyDown(KeyCode.S))
     {
         ShowControls sc = ShowControls.CreateDocked(new ControlItem("An example of showing a mouse click", MouseButton.LeftClick));
         sc.destroyWhenDone = true;
         sc.Show();
     }
     if (Input.GetKeyDown(KeyCode.D))
     {
         ShowControls sc = ShowControls.CreateDocked(new ControlItem("An example of showing click & drag", MouseDirection.Both, MouseButton.RightClick));
         sc.destroyWhenDone = true;
         sc.Show();
     }
     if (Input.GetKeyDown(KeyCode.F))
     {
         ShowControls sc = ShowControls.CreateDocked(new[] {
             new ControlItem("An example of a mouse click with a modifier key", KeyCode.LeftControl, MouseButton.LeftClick),
             new ControlItem("Also an example of showing multiple keys AND mouse button AND direction, and showing multiple controls at once", new[] { KeyCode.LeftShift, KeyCode.LeftControl }, MouseDirection.Horizontal, MouseButton.RightClick)
         });
         sc.destroyWhenDone = true;
         sc.Show();
     }
 }
Пример #3
0
    void AddPowerup(string powerup)
    {
        // create a new docked ShowControls, and also add the control
        // to the fullscreen list.
        switch (powerup)
        {
        case "Jump":
            hasJump = true;
            fullscreen.controls.Add(new ControlItem(jumpFull, KeyCode.Space));

            /* create the "jump" dock.  We don't need to keep track of the
             * ShowControls it returns, as it will take care of itself
             * when the duration runs out.  Create it, & immediately show it. */
            ShowControls.CreateDocked(new ControlItem(jumpPopup, KeyCode.Space)).Show();
            break;

        case "Die":
            hasDie = true;
            fullscreen.controls.Add(new ControlItem(dieFull, MouseButton.LeftClick));

            /* Create the "die" dock.  We don't show it immediately because
             * we want to adjust the duration before showing. */
            dieDock = ShowControls.CreateDocked(new ControlItem(diePopup, MouseButton.LeftClick));
            dieDock.showDuration = -1;
            dieDock.Show();
            break;
        }
    }
Пример #4
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;
    }
Пример #5
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;
	}
Пример #6
0
 public void Start()
 {
     birdTargets = FindObjectsOfType <BirdTarget>();
     uiTime.text = timeTotal.ToString(".0");
     // web player doesn't need the exit button
     if (Application.platform == RuntimePlatform.WebGLPlayer)
     {
         GameObject.Destroy(exitButton);
     }
     controls = ShowControls.CreateDocked(new ControlItem[] {
         new ControlItem("Use arrow keys to walk left and right",
                         new KeyCode[] { KeyCode.LeftArrow, KeyCode.RightArrow }),
         new ControlItem("Press space to jump", KeyCode.Space)
     });
     controls.position     = ShowControlPosition.Bottom;
     controls.showDuration = -1;
     controls.Show();
 }
Пример #7
0
    void InitShowControls()
    {
        scCancel = ShowControls.CreateDocked(new ControlItem("Skip Tutorial", KeyCode.Escape));
        scCancel.position = ShowControlPosition.Bottom;
        scCancel.showDuration = -1;
        scCancel.size = ShowControlSize.Small;
        scCancel.Show();

        scAttack = ShowControls.CreateDocked(new ControlItem[] {
            new ControlItem("Move Penthos around", CustomDisplay.arrows),
            new ControlItem("Attack the draglins!", KeyCode.LeftControl)
        });
        scAttack.showDuration = -1;

        scToggle1 = ShowControls.CreateDocked(new ControlItem("Hold to open a rift, cleansing the corruption from this location and all nearby locations.", KeyCode.Space));
        scToggle1.showDuration = -1;

        scToggle2 = ShowControls.CreateDocked(new ControlItem("Beware, any clear location will also become corrupted.  Fully cleanse each level to continue.", KeyCode.Space));
        scToggle2.showDuration = -1;
    }
Пример #8
0
    void Update()
    {
        if (Input.GetKeyDown(fsBlender.fullscreenClearKey))
        {
            fsUnity.Hide();
            fsBlender.Toggle();
        }
        if (Input.GetKeyDown(fsUnity.fullscreenClearKey))
        {
            fsBlender.Hide();
            fsUnity.Toggle();
        }
        if (!fsBlender.IsShown && !fsUnity.IsShown)
        {
            fsTop.Show();

            /* if we're pressing the key for the temp ShowControls and
             * it doesn't already exist, instantiate it.  When it's done,
             * it'll automatically Destroy itself and we'll be able to
             * make it again. */
            if (Input.GetKeyDown(bottomTempKey) && bottomTmp == null)
            {
                bottomTmp = ShowControls.CreateDocked(new[] {
                    new ControlItem(descBottomTemp, bottomTempKey)
                });
                bottomTmp.offsetX         = Screen.width / 2;
                bottomTmp.showDuration    = 5;
                bottomTmp.position        = ShowControlPosition.Bottom;
                bottomTmp.destroyWhenDone = true;
                bottomTmp.Show();
            }
            if (Input.GetKeyDown(bottomPermKey))
            {
                bottomPerm.Toggle();
            }
        }
        else
        {
            fsTop.Hide();
        }
    }
Пример #9
0
    // Use this for initialization
    void Start()
    {
        stages.Add("Start", 1);
        stages.Add("doStage2", 2);
        stages.Add("doStage3", 3);
        stages.Add("doStage4", 4);

        scStart = ShowControls.CreateDocked(
            new ControlItem("Welcome to Muffin the Destroyer!\n\nUse left and right to move Muffins.  Walk right to continue",
                new[] { KeyCode.LeftArrow, KeyCode.RightArrow }));
        sc2 = ShowControls.CreateDocked(
            new ControlItem("Use Z to jump, press Z again in mid-air to stomp!",
                KeyCode.Z));
        sc3 = ShowControls.CreateDocked(
            new ControlItem("Press X to swipe in front of you.",
                KeyCode.X));

        scStart.showDuration = -1;
        sc2.showDuration = -1;
        sc3.showDuration = -1;

        scStart.Show();
    }
Пример #10
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();
	}
Пример #11
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();
    }
Пример #12
0
 public void Start()
 {
     CuteMusicPlayer.Instance.PlayMusic("stageMusic");
     string moveDesc = "Use the arrow keys to move the player around.";
     string attackDesc = "Hold the spacebar to aim an Super Headbutt.  Hold a direction to headbutt, and release the spacebar to let it fly!";
     if(showControls) {
         sc = ShowControls.CreateDocked(new ControlItem[] {
             new ControlItem(moveDesc, CustomDisplay.arrows),
             new ControlItem(attackDesc, KeyCode.Space)
         });
         sc.slideSpeed = -1;
         sc.showDuration = -1;
         sc.Show();
     }
 }
Пример #13
0
 public void Start()
 {
     birdTargets = FindObjectsOfType<BirdTarget>();
     uiTime.text = timeTotal.ToString(".0");
     // web player doesn't need the exit button
     if (Application.platform == RuntimePlatform.WebGLPlayer) {
             GameObject.Destroy(exitButton);
     }
     controls = ShowControls.CreateDocked(new ControlItem[] {
         new ControlItem("Use arrow keys to walk left and right",
             new KeyCode[] { KeyCode.LeftArrow, KeyCode.RightArrow }),
         new ControlItem("Press space to jump", KeyCode.Space)
     });
     controls.position = ShowControlPosition.Bottom;
     controls.showDuration = -1;
     controls.Show();
 }