如何制作标准的 Unity 选项菜单?

How to make a standard Unity Options Menu?

我正在尝试在资产商店或 API 中找到标准资产,这可能会让我在不到几个小时的时间内创建一个标准选项菜单,无论 Unity 5 提供什么。预制件或类似的东西是理想的。

到目前为止,我发现 QualitySettings.names 和其他一些,但与我可以立即使用的音频和键绑定的标准块完全不同。

提前致谢!

您是在谈论创建一个 ingame 菜单/场景来在运行时控制多个选项吗?自己写很容易,你已经找到了 QualitySettings class 和 SetQualityLevel() 函数(Documentation). You can define your own additional quality levels (shadow quality, resolution, Vsync, Anti-Aliasing, Post-Effects etc.) in your project, but unity already has a few. For the audio part, we have the AudioSettings class (Documentation, Reset(config)), with which you can control a few things (AudioSpeakerMode, SampleRate, DspBuffer etc.). The overall volume can be controlled per scene in the audio manager (Documentation), but this is not runtime-scriptable. Instead, control the AudioListener component on your camera, you'd need to write some additional logic for that. The keybindings are controlled through Unity's input configuration and you get a window at startup, so that is already customizable. If you want to control that via script, have a look at this。我希望这能给你一些指导。