要使用的实时阴影类型。
这决定了应该使用哪种类型的阴影。可选项包括硬阴影和软阴影、仅硬阴影以及禁用阴影。
其他资源:Light.shadows。
using UnityEngine;
// Let the shadow quality be selected
public class ExampleScript : MonoBehaviour { private int selection = 0; private string[] itemName = {" Disable ", " HardOnly ", " Hard and Soft "};
void Start() { QualitySettings.shadows = ShadowQuality.All; }
void OnGUI() { GUILayout.BeginVertical("Box"); selection = GUILayout.SelectionGrid(selection, itemName, 1, GUILayout.MinWidth(200), GUILayout.MinHeight(100)); GUILayout.EndVertical();
switch (selection) { case 0: QualitySettings.shadows = ShadowQuality.Disable; break; case 1: QualitySettings.shadows = ShadowQuality.HardOnly; break; default: QualitySettings.shadows = ShadowQuality.All; break; } } }