Unity QualitySettings.SetQualityLevel 设置质量级别
Posted peng18233754457
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unity QualitySettings.SetQualityLevel 设置质量级别相关的知识,希望对你有一定的参考价值。
QualitySettings.SetQualityLevel 设置质量级别
public static void QualitySettings.SetQualityLevel(int index)
public static void SetQualityLevel(int index, [DefaultValue("true")] bool applyExpensiveChanges);
Description 描述
Sets a new graphics quality level.
设置新的图形质量级别。
Note that changing the quality level can be an expensive operation if the new level has different anti-aliasing setting. It‘s fine to change the level when applying in-game quality options, but if you want to dynamically adjustquality level at runtime, pass false to applyExpensiveChanges so that expensive changes are not always applied.
注意改变质量级别可能是个昂贵的操作,如果新级别有不同的抗锯齿设置。当应用游戏质量选项可以很好改变该级别,但是如果你想在运行时动态调整级别,通过applyExpensiveChanges 设置为false,这样昂贵的变化并不总是被应用。
When building a player quality levels that are not used for that platform are stripped. You should not expect a given quality setting to be at a given index. It‘s best to query the available quality settings and use the returned index.
建立的玩家质量级别是不被抛离平台的。你不应该期待指定质量设置在指定索引中。它最好查询可获取质量设置并使用返回索引。
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void OnGUI() { string[] names = QualitySettings.names; GUILayout.BeginVertical(); int i = 0; while (i < names.Length) { if (GUILayout.Button(names[i])) QualitySettings.SetQualityLevel(i, true); i++; } GUILayout.EndVertical(); } }
以上是关于Unity QualitySettings.SetQualityLevel 设置质量级别的主要内容,如果未能解决你的问题,请参考以下文章
Unity3D资源文件 ③ ( Unity 资源包简介 | 导出 Unity 资源包 | 导出资源包的包含依赖选项 | 导入 Unity 资源包 | Unity 资源商店 )