Skip to content

Commit ddb9935

Browse files
committed
fix: AOT issue
1 parent 7f24966 commit ddb9935

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

CHANGELOG.MD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.2.6]
8+
## Changed
9+
- Fixed AOT issue.
10+
711
## [1.2.5]
812
## Changed
913
- Fixed issue with the read only lists not refreshing properly on Inspector calls on PlayMode.
@@ -129,6 +133,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
129133
## [Unreleased]
130134
- Proper setup for automatic creation of necessary collections
131135

136+
[1.2.6]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.2.6
132137
[1.2.5]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.2.5
133138
[1.2.4]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.2.4
134139
[1.2.3]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.2.3

Scripts/Editor/Utils/CollectionUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ private static void CreateNewItem()
2727
[MenuItem("Assets/Create/ScriptableObject Collection/Create Settings", false, 200)]
2828
private static void CreateSettings()
2929
{
30-
ScriptableObjectCollectionSettings.LoadOrCreateInstance();
30+
ScriptableObjectCollectionSettings.LoadOrCreateInstance<ScriptableObjectCollection>();
3131
}
3232

3333
public static Editor GetEditorForItem(CollectableScriptableObject collectionItem)

Scripts/Runtime/CollectionsRegistry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class CollectionsRegistry : ResourceScriptableObjectSingleton<Collections
1515

1616
public void UsedOnlyForAOTCodeGeneration()
1717
{
18-
LoadOrCreateInstance();
18+
LoadOrCreateInstance<CollectionsRegistry>();
1919
// Include an exception so we can be sure to know if this method is ever called.
2020
throw new InvalidOperationException("This method is used for AOT code generation only. Do not call it at runtime.");
2121
}

Scripts/Runtime/ResourceScriptableObjectSingleton.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ public static T Instance
1111
get
1212
{
1313
if (instance == null)
14-
instance = LoadOrCreateInstance();
14+
instance = LoadOrCreateInstance<T>();
1515
return instance;
1616
}
1717
}
1818

1919
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
20-
public static T LoadOrCreateInstance()
20+
public static T LoadOrCreateInstance<T>() where T: ScriptableObject
2121
{
2222
T newInstance = Resources.Load<T>(typeof(T).Name);
2323

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.brunomikoski.scriptableobjectcollection",
33
"displayName": "Scriptable Object Collection",
4-
"version": "1.2.5",
4+
"version": "1.2.6",
55
"unity": "2018.4",
66
"description": "Scriptable Object Collection",
77
"keywords": [

0 commit comments

Comments
 (0)