settingsPath | 要选择的项目的设置路径(例如,“Project/Player”或“Project/Quality”)。 |
EditorWindow 返回设置窗口的实例。
打开项目设置窗口,并已选择指定的设置项。
using UnityEditor; using UnityEngine;
class MyCustomWindow : EditorWindow { void OnGUI() { if (GUILayout.Button("Open my custom preference")) { SettingsService.OpenUserPreferences("Preferences/MyCustomPref"); }
if (GUILayout.Button("Open my custom project settings")) { SettingsService.OpenProjectSettings("Project/MyCustomSettings"); } } }