Parameter | Description |
---|---|
callback | The callback to execute for each level. |
Executes the given Action for each Quality Level configured in QualitySettings.
This method iterates through the configured quality levels and invokes the callback for every one. When this method returns, the original quality level is restored.
The following example adds a helper menu item that sets the Vsync Count setting on every quality level to "Don't Sync".
using UnityEngine; using UnityEditor;
public class ForEachQualityLevelExample { [MenuItem("Tools/Disable Vsync for All Quality Levels")] static void DisableVsync() { QualitySettings.ForEach(() => { QualitySettings.vSyncCount = 0; }); } }