示例#1
0
 public static TBSettings.TBQualitySettings GetDefaultQualitySettings(TBSettings.TBQualitySettings qualitySettings)
 {
     qualitySettings.textureQuality       = TBSettings.TBTextureSize.FullRes;
     qualitySettings.antialiasingLevel    = TBSettings.TBAntialiasingLevel._4x;
     qualitySettings.anisotropicFiltering = AnisotropicFiltering.ForceEnable;
     qualitySettings.pixelLighCount       = 10;
     qualitySettings.softParticles        = true;
     qualitySettings.shadowQuality        = ShadowQuality.All;
     qualitySettings.shadowResolution     = ShadowResolution.VeryHigh;
     qualitySettings.LODbias          = 2;
     qualitySettings.maximumLODLevel  = 0;
     qualitySettings.shadowProjection = ShadowProjection.CloseFit;
     qualitySettings.shadowDistance   = 100;
     qualitySettings.blendWeights     = BlendWeights.FourBones;
     return(qualitySettings);
 }
        protected void ShowQualitySettings(ref TBSettings.TBQualitySettings settings)
        {
            StartSettingsSection();
            EditorGUILayout.LabelField("Quality Settings", TBEditorStyles.h2);
            settings.enableQualitySettingsOverride = EditorGUILayout.BeginToggleGroup("Override Unity Quality Settings", settings.enableQualitySettingsOverride);

            EditorGUILayout.Separator();

            EditorGUILayout.LabelField("Rendering");
            settings.pixelLighCount           = (int)EditorGUILayout.IntField(new GUIContent("Pixel Light Count", "Number of pixel lights allowed."), settings.pixelLighCount);
            settings.textureQuality           = (TBSettings.TBTextureSize)EditorGUILayout.EnumPopup(new GUIContent("Texture Quality", "Base texture level."), settings.textureQuality);
            settings.anisotropicFiltering     = (AnisotropicFiltering)EditorGUILayout.EnumPopup(new GUIContent("Anisotropic Filtering", "Improves quality and removes stitching artifacts from mipmaps on surfaces at oblique viewing angles, at some GPU cost."), settings.anisotropicFiltering);
            settings.antialiasingLevel        = (TBSettings.TBAntialiasingLevel)EditorGUILayout.EnumPopup(new GUIContent("Antialiasing", "MSAA level applied."), settings.antialiasingLevel);
            settings.softParticles            = EditorGUILayout.Toggle(new GUIContent("Soft Particles", "Soft blending on particles. May be expensive because it requires the camera to render a depth texture."), settings.softParticles);
            settings.realtimeReflectionProbes = EditorGUILayout.Toggle(new GUIContent("Realtime Reflection Probes", "Allow realtime reflection probes?"), settings.realtimeReflectionProbes);

            EditorGUILayout.Separator();
            EditorGUILayout.LabelField("Shadows");
            settings.shadowQuality = (ShadowQuality)EditorGUILayout.EnumPopup(new GUIContent("Shadows Allowed", "Shadow quality."), settings.shadowQuality);
            EditorGUI.BeginDisabledGroup(settings.shadowQuality != ShadowQuality.Disable);
            settings.shadowResolution      = (ShadowResolution)EditorGUILayout.EnumPopup(new GUIContent("Shadow Resolution", "Default resolution of shadow maps."), settings.shadowResolution);
            settings.shadowProjection      = (ShadowProjection)EditorGUILayout.EnumPopup(new GUIContent("Shadow Projection", "Close = higher res, Stable = less wobbly."), settings.shadowProjection);
            settings.shadowDistance        = (int)EditorGUILayout.IntField(new GUIContent("Shadow Distance", "Max distance shadows will be drawn."), settings.shadowDistance);
            settings.shadowNearPlaneOffset = (int)EditorGUILayout.IntField(new GUIContent("Shadow Near Plane Offset", "Offset to prevent shadow pancaking."), settings.shadowDistance);
            EditorGUI.EndDisabledGroup();

            EditorGUILayout.Separator();

            EditorGUILayout.LabelField("Other");
            settings.blendWeights    = (BlendWeights)EditorGUILayout.EnumPopup(new GUIContent("Blend Weights", "Bone count for mesh skinning."), settings.blendWeights);
            settings.LODbias         = (float)EditorGUILayout.FloatField(new GUIContent("LOD Bias", "Less than 1 favors less detail, greater than 1 favors high detail."), settings.LODbias);
            settings.maximumLODLevel = (int)EditorGUILayout.IntField(new GUIContent("Maximum LOD Level", "Highest LOD to use (0 is highest quality)."), settings.maximumLODLevel);
            EditorGUILayout.EndToggleGroup();

            EndSettingsSection();
        }