diff --git a/Assets/VisualElements/R2EKSettings.uxml b/Assets/VisualElements/R2EKSettings.uxml
index 610a121..d2742bd 100644
--- a/Assets/VisualElements/R2EKSettings.uxml
+++ b/Assets/VisualElements/R2EKSettings.uxml
@@ -8,7 +8,6 @@
-
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fef78e0..32cbb08 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+### '5.1.0'
+
+* General Changes:
+ * Non Core Assemblies (RoR2.Editor.Scripts, RoR2.Editor.R2API, RoR2.Editor.Thunderkit) will only load when the required packages are installed utilizing the Version Defines system of AssemblyDefinitions.
+
+* Core Changes:
+ * Removed logs from ``AssetDatabase.LoadAssetFromGUID`` to avoid generating multiple logs when being called by IMGUI related methods.
+ * Removed "Enable ThunderKit Integration" option from the main settings, as the ThunderKit integration now becomes enabled and disabled automatically depending on the AssemblyDef's Version Defines.
+
### '5.0.4'
* Core Changes:
diff --git a/Editor/Core/AssetDatabaseUtil.cs b/Editor/Core/AssetDatabaseUtil.cs
index d1b842f..9d52c44 100644
--- a/Editor/Core/AssetDatabaseUtil.cs
+++ b/Editor/Core/AssetDatabaseUtil.cs
@@ -84,14 +84,12 @@ public static T LoadAssetFromGUID(GUID guid, Func defaultInitializer = nul
var path = AssetDatabase.GUIDToAssetPath(guid);
if (string.IsNullOrEmpty(path))
{
- Debug.LogWarning($"Cannot load asset with guid {guid} as the AssetDatabase doesnt contain said guid.");
return defaultInitializer?.Invoke() ?? default(T);
}
T obj = AssetDatabase.LoadAssetAtPath(path);
if (!obj)
{
- Debug.LogWarning($"Cannot load asset with guid {guid} using type {typeof(T).Name}.");
return defaultInitializer?.Invoke() ?? default(T);
}
return obj;
diff --git a/Editor/Core/Data/EditorSettingManager.cs b/Editor/Core/Data/EditorSettingManager.cs
index 86bdeb8..2cc7a09 100644
--- a/Editor/Core/Data/EditorSettingManager.cs
+++ b/Editor/Core/Data/EditorSettingManager.cs
@@ -262,7 +262,7 @@ private static EditorSettingCollection GetEditorSetting(Type editorType, IEditor
return editorSetting;
}
- throw new NullReferenceException($"Setting for editor type {editorType} within {provider.providerName} does not exist.");
+ return null;
}
private static EditorSettingCollection CreateSettingsFor(Type editorType, SettingType settingType, IEditorSettingProvider provider)
diff --git a/Editor/R2APISupport/AddressReferencedAssetDrawer.cs b/Editor/R2APISupport/AddressReferencedAssetDrawer.cs
index cf9e746..b831a7a 100644
--- a/Editor/R2APISupport/AddressReferencedAssetDrawer.cs
+++ b/Editor/R2APISupport/AddressReferencedAssetDrawer.cs
@@ -1,4 +1,4 @@
-#if RISKOFRAIN2 && RISKOFTHUNDER_R2API_ADDRESSABLES
+#if R2EK_R2API_ADDRESSABLES
using R2API.AddressReferencedAssets;
using System;
using System.Collections.Generic;
diff --git a/Editor/R2APISupport/RoR2.Editor.R2API.asmdef b/Editor/R2APISupport/RoR2.Editor.R2API.asmdef
index 5a29308..eecee5e 100644
--- a/Editor/R2APISupport/RoR2.Editor.R2API.asmdef
+++ b/Editor/R2APISupport/RoR2.Editor.R2API.asmdef
@@ -23,9 +23,25 @@
],
"autoReferenced": true,
"defineConstraints": [
- "RISKOFTHUNDER_R2API_ADDRESSABLES",
- "RISKOFRAIN2"
+ "R2EK_R2API_ENABLE",
+ "R2EK_ROR2_IMPORTED"
+ ],
+ "versionDefines": [
+ {
+ "name": "riskofrain2",
+ "expression": "[1.3.1]",
+ "define": "R2EK_ROR2_IMPORTED"
+ },
+ {
+ "name" : "riskofthunder-r2api_addressables",
+ "expression" : "1.0.3",
+ "define": "R2EK_R2API_ADDRESSABLES"
+ },
+ {
+ "name" : "riskofthunder-r2api_core",
+ "expression" : "5.1.1",
+ "define": "R2EK_R2API_ENABLE"
+ }
],
- "versionDefines": [],
"noEngineReferences": false
}
\ No newline at end of file
diff --git a/Editor/RoR2/RoR2.Editor.Scripts.asmdef b/Editor/RoR2/RoR2.Editor.Scripts.asmdef
index 198dccd..08d11af 100644
--- a/Editor/RoR2/RoR2.Editor.Scripts.asmdef
+++ b/Editor/RoR2/RoR2.Editor.Scripts.asmdef
@@ -25,8 +25,14 @@
],
"autoReferenced": true,
"defineConstraints": [
- "RISKOFRAIN2"
+ "R2EK_ROR2_IMPORTED"
+ ],
+ "versionDefines": [
+ {
+ "name": "riskofrain2",
+ "expression": "[1.3.1]",
+ "define": "R2EK_ROR2_IMPORTED"
+ }
],
- "versionDefines": [],
"noEngineReferences": false
}
\ No newline at end of file
diff --git a/Editor/ThunderkitSupport/RoR2.Editor.ThunderKit.asmdef b/Editor/ThunderkitSupport/RoR2.Editor.ThunderKit.asmdef
index f2f365b..68f8ada 100644
--- a/Editor/ThunderkitSupport/RoR2.Editor.ThunderKit.asmdef
+++ b/Editor/ThunderkitSupport/RoR2.Editor.ThunderKit.asmdef
@@ -19,8 +19,20 @@
],
"autoReferenced": true,
"defineConstraints": [
- "R2EK_THUNDERKIT"
+ "R2EK_THUNDERKIT",
+ "R2EK_ROR2_IMPORTED"
+ ],
+ "versionDefines": [
+ {
+ "name": "com.passivepicasso.thunderkit",
+ "expression": "9.0.0",
+ "define": "R2EK_THUNDERKIT"
+ },
+ {
+ "name": "riskofrain2",
+ "expression": "[1.3.1]",
+ "define": "R2EK_ROR2_IMPORTED"
+ }
],
- "versionDefines": [],
"noEngineReferences": false
}
\ No newline at end of file
diff --git a/package.json b/package.json
index 0ce526a..449a782 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,7 @@
"url": ""
},
"displayName": "RoR2EditorKit",
- "version": "5.0.2",
+ "version": "5.1.0",
"unity": "2021.3",
"description": "The Risk of Rain 2 Editor Kit (Abreviated as ROR2EK) is a Thunderkit Extension designed specifically for helping mod creators create content for Risk of Rain 2.",
"dependencies": {