private void ShowPrompt()
 {
     foreach (Prompt item in prompts)
     {
         item.textPrompt.text = KeybindingController.GetKeybindName(item.control);
     }
 }
Exemple #2
0
    public void StopRebindProcess()
    {
        Rebinding = false;

        foreach (KeybindButton keybindButton in keybindButtons)
        {
            keybindButton.SetKeybindText(KeybindingController.GetKeybindName(keybindButton.Control));
        }

        StartCoroutine(RemoveUIBlocker());
    }
Exemple #3
0
    private void SetUpControlsMenu()
    {
        keybindButtons = new List <KeybindButton>();

        int   controlsCount = System.Enum.GetValues(typeof(GameControls)).Length;
        float yScale        = keybindButtonPrefab.GetComponent <RectTransform>().sizeDelta.y;

        contentWindow.sizeDelta = new Vector2(contentWindow.sizeDelta.x, (controlsCount - 1) * yScale); // count - 1 so ESCAPE can't be rebound

        for (int i = 0; i < controlsCount - 1; i++)
        {
            GameControls  c             = (GameControls)i;
            KeybindButton keybindButton = Instantiate(keybindButtonPrefab, contentWindow);
            keybindButton.SetUp(-yScale * i, c, KeybindingController.GetKeybindName(c));

            keybindButtons.Add(keybindButton);
        }

        uiBlocker.SetActive(false);
        keybindExplanation.SetActive(false);
    }
Exemple #4
0
    public void CycleDefaultControls(int dir)
    {
        controlsIndex += dir;

        if (controlsIndex < 0)
        {
            controlsIndex = defaultControlsCount - 1;
        }
        else if (controlsIndex >= defaultControlsCount)
        {
            controlsIndex = 0;
        }

        controlscheme.text = controlSchemes[controlsIndex];

        KeybindingController.SetControls(controlsIndex);

        foreach (KeybindButton kb in keybindButtons)
        {
            kb.SetKeybindText(KeybindingController.GetKeybindName(kb.Control));
        }
    }