Skip to content

Commit 61ef012

Browse files
authored
Merge pull request #117 from brunomikoski/feature/updates-for-200
Feature/updates for 200
2 parents b66ff27 + ec49cb5 commit 61ef012

43 files changed

Lines changed: 809 additions & 1169 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.MD

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.0.0]
10+
### Changed
11+
- Fixed issue with name parser that would still treat digits as string and added to the final name
12+
- Fixed issue with PropertyDrawer of indirect reference without attribute would cause a null reference
13+
- Refactored the system to use ScriptableObject as a base class instead of `ScriptableObjectCollectionItem` now any `ScriptableObject` can be used as a collection item as long as implements the `ISCOItem` interface
14+
- Fixed issue with `CollectionItemPicker` that would not work properly with `ScriptableObject` that are not in the same assembly as the `ScriptableObjectCollection`
15+
- Added new buttons on CollectionRegistry to force guid validation on all items
16+
- Reduced automatic collection guid reloading to reduce performance impact on larger projects
17+
- Fixed issues with target scripts generation folder not being saved properly
18+
- Minimum supported Unity version is now 2021 _(I'm DONE with 2020, its the worst unity ever 😒)_
19+
20+
### Removed
21+
- Removed support for Addressables, it was not working properly and it was not being used by a lot of teams, I think the addressables support should be handled elsewhere.
22+
23+
### Breaking Changes
24+
- If you used the Addressables integration `SOC_ADDRESSABLES_SUPPORT` be extra careful when upgrading
25+
- The old string based guid system has been replaced for a lighter version `LongGuid`
26+
- If you are using IndirectReferences all the references will be lost, you will need to re-set them
27+
28+
### Upgrade Guide from 1.x.x to 2.x.x
29+
- Update the package
30+
- Make sure you click on the `CollectionRegistry` and click on the `Validate Collections` button
31+
- Regenerate all your Static Code Files
32+
33+
934
# [1.9.7]
1035
### Added
1136
- Initial string search support
1237

13-
1438
### Changed
1539
- Fixed issue with namespace not been updated on first usage
1640

@@ -384,6 +408,7 @@ public bool IsValidConsumable(Consumable consumable)
384408
### Added
385409
- First initial working version
386410

411+
[2.0.0]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v2.0.0
387412
[1.9.7]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.9.7
388413
[1.9.6]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.9.6
389414
[1.9.5]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.9.5

Scripts/Editor/BrunoMikoski.ScriptableObjectCollection.Editor.asmdef

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"name": "BrunoMikoski.ScriptableObjectCollection.Editor",
33
"rootNamespace": "",
44
"references": [
5-
"BrunoMikoski.ScriptableObjectCollection",
6-
"Unity.Addressables.Editor"
5+
"BrunoMikoski.ScriptableObjectCollection"
76
],
87
"includePlatforms": [
98
"Editor"
@@ -14,12 +13,6 @@
1413
"precompiledReferences": [],
1514
"autoReferenced": true,
1615
"defineConstraints": [],
17-
"versionDefines": [
18-
{
19-
"name": "com.unity.addressables",
20-
"expression": "1.0.0",
21-
"define": "SOC_ADDRESSABLES"
22-
}
23-
],
16+
"versionDefines": [],
2417
"noEngineReferences": false
2518
}

Scripts/Editor/Core/CollectionAssetsModificationProcessor.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using UnityEditor;
3+
using UnityEngine;
4+
using Object = System.Object;
35

46
namespace BrunoMikoski.ScriptableObjectCollections
57
{
@@ -13,12 +15,16 @@ public static AssetDeleteResult OnWillDeleteAsset(string targetAssetPath, Remove
1315

1416
Type type = mainAssetAtPath.GetType();
1517

16-
if (type.IsSubclassOf(typeof(ScriptableObjectCollectionItem)))
18+
if (type.IsSubclassOf(typeof(ScriptableObject)))
1719
{
18-
ScriptableObjectCollectionItem collectionItem =
19-
AssetDatabase.LoadAssetAtPath<ScriptableObjectCollectionItem>(targetAssetPath);
20+
ScriptableObject collectionItem =
21+
AssetDatabase.LoadAssetAtPath<ScriptableObject>(targetAssetPath);
2022

21-
collectionItem.Collection.Remove(collectionItem);
23+
ISOCItem socItem = collectionItem as ISOCItem;
24+
if (socItem == null)
25+
return AssetDeleteResult.DidNotDelete;
26+
27+
socItem.Collection.Remove(collectionItem);
2228
return AssetDeleteResult.DidNotDelete;
2329
}
2430

0 commit comments

Comments
 (0)