mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 17:56:06 +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>
|
/// <summary> Very crude. Uses a lot of reflection. </summary>
|
||||||
public static void OpenPreferences() {
|
public static void OpenPreferences() {
|
||||||
try {
|
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
|
//Open preferences window
|
||||||
Assembly assembly = Assembly.GetAssembly(typeof(UnityEditor.EditorWindow));
|
Assembly assembly = Assembly.GetAssembly(typeof(UnityEditor.EditorWindow));
|
||||||
Type type = assembly.GetType("UnityEditor.PreferencesWindow");
|
Type type = assembly.GetType("UnityEditor.PreferencesWindow");
|
||||||
@ -132,6 +142,7 @@ namespace XNodeEditor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Debug.LogError(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.");
|
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