Exemplo n.º 1
0
    //[Header("Controls Tab")]

    private void OnEnable()
    {
        clickToClose.OnClick += Close;
        closeButton.OnClick  += Close;
        //Set Screen Mode drop-down
        if (Screen.fullScreen)
        {
            //Fullscreen
            screenMode.chosenIndex = 1;
        }
        else
        {
            //Windowed
            screenMode.chosenIndex = 0;
        }
        screenMode.SetHeader(screenMode.chosenIndex);
        screenMode.OnChoiceMade += ScreenMode_OnChoiceMade;
        //Screen Resolution
        switch (Screen.width)
        {
        case 1920: resolution.chosenIndex = 0; break;

        case 1600: resolution.chosenIndex = 1; break;

        case 1366:
        case 1360: resolution.chosenIndex = 2; break;

        case 1280: resolution.chosenIndex = 3; break;

        default: resolution.chosenIndex = 4; break;
        }
        resolution.SetHeader(resolution.chosenIndex);
        resolution.OnChoiceMade += Resolution_OnChoiceMade;
        //Quality
        quality.OnChoiceMade += Quality_OnChoiceMade;
        //UI Scale
        uiScale.OnChoiceMade += UiScale_OnChoiceMade;
        //Lappy BG
        lappyBG.chosenIndex = lappyMenu.chosenBGIndex;
        lappyBG.SetHeader(lappyBG.chosenIndex);
        lappyBG.OnChoiceMade += LappyBG_OnChoiceMade;
        //mouseSensitivity
        mouseSensitivity.value = UI.Instance.mouseSensitivity;
        mouseSensitivity.onValueChanged.AddListener(delegate { mouseSensitivity_onValueChanged(); });
    }