mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
Unity 2018.3 support
This commit is contained in:
parent
dc608a3d1b
commit
604365ce67
@ -101,6 +101,16 @@ namespace XNodeEditor {
|
||||
/// <summary> Very crude. Uses a lot of reflection. </summary>
|
||||
public static void OpenPreferences() {
|
||||
try {
|
||||
#if UNITY_2018_3_OR_NEWER
|
||||
SettingsProvider[] providers = SettingsService.FetchSettingsProviders();
|
||||
|
||||
foreach (SettingsProvider settingsProvider in providers) {
|
||||
if (settingsProvider.name == "Node Editor") {
|
||||
EditorPrefs.SetString("SettingsWindow_Settings_current_provider", settingsProvider.settingsPath);
|
||||
EditorApplication.ExecuteMenuItem("Edit/Preferences...");
|
||||
}
|
||||
}
|
||||
#else
|
||||
//Open preferences window
|
||||
Assembly assembly = Assembly.GetAssembly(typeof(UnityEditor.EditorWindow));
|
||||
Type type = assembly.GetType("UnityEditor.PreferencesWindow");
|
||||
@ -132,6 +142,7 @@ namespace XNodeEditor {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} catch (Exception e) {
|
||||
Debug.LogError(e);
|
||||
Debug.LogWarning("Unity has changed around internally. Can't open properties through reflection. Please contact xNode developer and supply unity version number.");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user