Skip to content

Commit cb63f0d

Browse files
committed
minor changes and readme update
1 parent 08ef2dc commit cb63f0d

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

Editor/SOVariant.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ private Tuple<string, T, List<string>, List<string>> ExtractData(string data)
216216
case (1):
217217
Debug.Log($"UserData not overwritten.");
218218
_SOVariantProperlyLoaded = false;
219-
Selection.activeObject = null;
220219
return null;
221220
case (2):
222221
return ExtractData(ReadUpdatedMetaFile(data));

Editor/SOVariantAttributeProcessor.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ public override void ProcessMemberProperties(List<InspectorPropertyInfo> propert
5858
{
5959
Selection.selectionChanged -= OnSelectionChanged;
6060
_selectionChangedFlag = false;
61-
6261
AssemblyReloadEvents.beforeAssemblyReload -= OnBeforeAssemblyReloads;
62+
63+
Selection.activeObject = null;
64+
65+
return;
6366
}
6467

6568
BoxGroupAttribute bxa = new BoxGroupAttribute("Scriptable Object Variant", true, false, 2);

Editor/UpgradeSOVariantHelper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public static void UpgradeSOVariantUserData()
2222

2323
var extractedData = ExtractData(importer.userData);
2424
var _parent = extractedData.Item1;
25+
if(_parent == null)
26+
continue;
2527
var _overridden = extractedData.Item3 ?? new List<string>();
2628
var _children = extractedData.Item4 ?? new List<string>();
2729

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,4 @@ if (AssetDatabase.GetAssetPath(parent) == AssetDatabase.GetAssetPath(target))
131131
```
132132
It would be alot better to directly filter the possible candidates when selecting in the object, but adding the `AssetSelector` attribute with a filter, or building a custom `ValueDropdown` both did not work, not sure why.
133133

134-
### [Data serialization (parent and overriden fields)](https://github.com/GieziJo/ScriptableObjectVariant/issues/4)
135-
As mentioned above, the serialized data is kept in `userData`, but is set with `_import.userData = *mySerializedDataString*`. This would override any other data that would come to this field from other scripts, might be an issue.
136-
137-
### [Saving Data](https://github.com/GieziJo/ScriptableObjectVariant/issues/5)
138-
Saving data to the `.meta` file occurs when the asset is deselected (`Selection.selectionChanged += OnSelectionChanged;`). It would be better to tie this to the serialization and deserialization of the data itself, but unity does not seem to expose the process as a delegate (not sure?), so I haven't found a way to tap into this routine.
139-
At least checking when the editor recompiles should be possible.
140-
141-
If the asset is not deselected in the editor before the editor reloads, the override changes are not saved.
142-
143134
</details>

0 commit comments

Comments
 (0)