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();

    }

}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM