Exemple #1
0
 private void SetKeys()
 {
     uitem[0].text.text = KeyboardConfig.ReturnKeyName(KeyboardConfig.hotbar1[0].ToString());
     uitem[1].text.text = KeyboardConfig.ReturnKeyName(KeyboardConfig.hotbar2[0].ToString());
     uitem[2].text.text = KeyboardConfig.ReturnKeyName(KeyboardConfig.hotbar3[0].ToString());
     uitem[3].text.text = KeyboardConfig.ReturnKeyName(KeyboardConfig.hotbar4[0].ToString());
 }
Exemple #2
0
 protected override void EnterRange()
 {
     base.EnterRange();
     io = obj.GetComponent <InteractableObjectText>();
     if (!chestOpened)
     {
         io.text.text = $"Press {TextColor.Green}{KeyboardConfig.ReturnKeyName(KeyboardConfig.action[0].ToString())} {TextColor.White} to open the Treasure Chest.";
     }
     else
     {
         io.text.text = $"Press {TextColor.Green}{KeyboardConfig.ReturnKeyName(KeyboardConfig.action[0].ToString())} {TextColor.White} to search the contents of the Chest.";
     }
     io.ToggleTextActive(true);
 }
Exemple #3
0
    void SwitchMenuState(MenuState newMenu, int options, int?index = null)
    {
        if (menuState == MenuState.AudioSettings)
        {
            DisableAudioSliders();
        }
        slider.gameObject.SetActive(options > 5);
        slider.maxValue = options > 5 ? (options - 5) * spacing : 1;
        for (int i = 0; i < menuOptions.Length; i++)
        {
            animators[i].SetBool("Hover", false);
            menuOptions[i].gameObject.SetActive(i < options);
            menuOptions[i].fontSize = oriFontSize;
        }

        menuState = newMenu;
        if (newMenu == MenuState.Settings)
        {
            menuOptions[0].text = "Controls";
            menuOptions[1].text = "Video Settings";
            menuOptions[2].text = "Audio Settings";
            menuOptions[3].text = "Back to Main Menu";
        }
        else if (newMenu == MenuState.Main)
        {
            menuOptions[0].text = "Start Game";
            menuOptions[1].text = "Load Game";
            menuOptions[2].text = "Settings";
            menuOptions[3].text = "Quit Game";
        }
        else if (newMenu == MenuState.VideoSettings)
        {
            menuOptions[0].text = $"Resolution {TextColor.Yellow}{GameSettings.resolutionX}{TextColor.White}x{TextColor.Yellow}{GameSettings.resolutionY}";
            menuOptions[1].text = $"Lighting Quality {TextColor.Yellow}{Lighting(QualitySettings.pixelLightCount)}";
            menuOptions[2].text = $"Fullscreen mode {TextColor.Yellow}" + (GameSettings.fullScreen ? "On" : "Off");
            menuOptions[3].text = "Back to Settings";
        }
        else if (newMenu == MenuState.LightingQuality)
        {
            menuOptions[0].text = $"{TextColor.Yellow}Low";
            menuOptions[1].text = $"{TextColor.Yellow}Medium";
            menuOptions[2].text = $"{TextColor.Yellow}High";
            menuOptions[3].text = $"{TextColor.Yellow}Highest";
            menuOptions[4].text = "Back to Video Settings";
        }
        else if (newMenu == MenuState.Resolutions)
        {
            for (int i = 0; i < resolutions.Length; i++)
            {
                menuOptions[i].text = $"{TextColor.Yellow}{resolutions[i].width}{TextColor.White}x{TextColor.Yellow}{resolutions[i].height}";
            }
            menuOptions[resolutions.Length].text = "Back to Video Settings";
        }
        else if (newMenu == MenuState.ControlSettings)
        {
            int i = 0;
            foreach (var key in keys)
            {
                menuOptions[i].text = $"{key.Key} {TextColor.Yellow}{KeyboardConfig.ReturnKeyName(key.Value[0].ToString())}";
                i++;
            }
            menuOptions[keys.Count].text = "Back to Settings";
        }
        else if (newMenu == MenuState.AudioSettings)
        {
            SetAudioSliders();
            menuOptions[0].text = "Master Volume";
            menuOptions[1].text = "Music Volume";
            menuOptions[2].text = "Sound Effects";
            menuOptions[3].gameObject.SetActive(false);
            menuOptions[4].text = "Back to Settings";
        }
        CheckRayCast();
    }