SettingsService.OpenUserPreferences
Declaration
public static EditorWindow OpenUserPreferences(string settingsPath);Параметры
| Параметр | Описание |
|---|---|
| settingsPath | Путь к настройкам элемента для выбора (например, 'Preferences/Keys' или 'Preferences/2D'). |
Возвращаемое значение
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"); } } }