Example #1
0
    public void RunDisplayColorMenu()
    {
        if (Input.GetButtonDown("Cancel")) { DoneMenu(); }

        int numberkey = GameplayUIManager.NumberKey();
        if(numberkey != -1 && numberkey < 7)
        {
            SetNewDisplayColor((DisplayColor)numberkey + 1);
        }
    }
Example #2
0
    public bool SelectedThingJustChanged; // used for when action is needed when the player scrolls (i.e. opening a menu). True during a single frame when UpdateSelectedThing has been run
    // TODO change to an abstract void now that I know what those are :P

    public void ScrollThroughMenu()
    {
        SelectedThingJustChanged = false;

        // move selected thing
        if (GameplayUIManager.ScrollUp())
        {
            if (SelectedThing > 0)
            {
                SelectedThing--; // go to the previous thing
            }
            else
            {
                SelectedThing = MaxSelectedThing; // allows the scrolling to loop
            }
            UpdateSelectedThing();
        }

        if (GameplayUIManager.ScrollDown())
        {
            if (SelectedThing < MaxSelectedThing)
            {
                SelectedThing++; // go to the next thing
            }
            else
            {
                SelectedThing = 0; // allows the scrolling to loop
            }
            UpdateSelectedThing();
        }

        // number key selection
        int selectkey = GameplayUIManager.NumberKey();

        if (selectkey != -1 && selectkey <= MaxSelectedThing)
        {
            SelectedThing = selectkey;
            UpdateSelectedThing();
        }
    }