Version: 2022.3

SettingsService.OpenProjectSettings

切换到手册
public static EditorWindow OpenProjectSettings (string settingsPath);

参数

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"); } } }