settingsPath | 要选择的项的设置路径(例如,“Project/Player”或“Project/Quality”)。 |
EditorWindow 向 Settings 窗口返回一个实例。
打开 Project Settings 窗口,其中已事先选择指定的设置项。
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"); } } }