Ejemplo n.º 1
0
    void UpdateSimpleGraphicItem(Transform root, GraphicSetting ppe)
    {
        Dropdown dropdown = root.GetComponentInChildren <Dropdown>();

        dropdown.options[0].text = "On";
        dropdown.options[1].text = "Off";

        dropdown.onValueChanged.RemoveAllListeners();
        dropdown.onValueChanged.AddListener(delegate
        {
            Settings.SetGraphicSetting(ppe, dropdown.value == 0);
        });
    }
Ejemplo n.º 2
0
    void UpdateOptionsMenu()
    {
        Transform l = _optionsPanel.transform.Find("list");

        //setup audio
        for (int i = 0; i < System.Enum.GetNames(typeof(VolumeSource)).Length; i++)
        {
            VolumeSource v = (VolumeSource)i;
            UpdateVolumeItem(l.Find(v.ToString().ToLower()), v);
        }
        //setup graphics
        for (int i = 0; i < System.Enum.GetNames(typeof(GraphicSetting)).Length; i++)
        {
            GraphicSetting g = (GraphicSetting)i;
            UpdateSimpleGraphicItem(l.Find(g.ToString().ToLower()), g);
        }
    }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        _graphicSetting = GraphicSetting.GlobalSetting;

        InitUi();

        m_FogToggle.onValueChanged.AddListener(SetFog);
        m_PostToggle.onValueChanged.AddListener(SetPostProcess);
        m_WaterNormalToggle.onValueChanged.AddListener(SetWaterNormal);

        m_maxFpsDropdown.onValueChanged.AddListener(DropdownMaxFps);
        m_QualityLevelDropdown.onValueChanged.AddListener(DropdownQualityLevel);
        m_ShaderLodLevelropdown.onValueChanged.AddListener(DropdownShaderLodLevel);
        m_ShadowQualityDropdown.onValueChanged.AddListener(DropdownShadowQuality);
        m_ShadowShowLevelDropdown.onValueChanged.AddListener(DropdownShadowShowLevel);

        m_CloseButton.onClick.AddListener(Close);
    }
    void ToggleGraphicSetting(GraphicSetting ppe, bool status)
    {
        //for (int i = 0; i < _profiles.Length; i++)
        //{
        //    switch (ppe)
        //    {
        //        case GraphicSetting.DepthOfField:
        //            var dof = _profiles[i].GetSetting<DepthOfField>();

        //            if(dof != null)
        //                dof.enabled.value = status;
        //            break;
        //        case GraphicSetting.MotionBlur:
        //            var mb = _profiles[i].GetSetting<MotionBlur>();

        //            if (mb != null)
        //                mb.enabled.value = status;
        //            break;
        //    }
        //}
    }
Ejemplo n.º 5
0
 public static void SetGraphicSetting(GraphicSetting ppe, bool status)
 {
     OnGraphicSettingChanged?.Invoke(ppe, status);
 }