You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Scriptable Object Variant for Unity (Scriptable Object Data Overrider)
7
+
8
+
> [!CAUTION]
9
+
> If you are upgrading from a pre-`2.0.0` version, please read the [upgrade section](#upgrading-to-200-from-previous-versions)
10
+
11
+
## Table of contents
12
+
-[Description](#description)
13
+
-[Usage](#usage)
14
+
-[Implementation](#implementation)
15
+
-[Installation](#installation)
16
+
-[Upgrading to 2.0.0 from previous versions](#upgrading-to-200-from-previous-versions)
17
+
-[Known issues and tweaks to be made](#known-issues-and-tweaks-to-be-made)
18
+
7
19
## Description
8
20
Adds a field to any scriptable object tagged with the `[SOVariant]` attribute that lets you select an original SO (parent) and override selected fields in the child object.
9
21
@@ -87,10 +99,19 @@ SOVariantHelper<ScriptableObject>.SetParentOverrideValues(target, parent, new Di
87
99
88
100
## Implementation
89
101
The visual interface is implemented in [Odin](odininspector.com/)'s [`OdinPropertyProcessor`](https://odininspector.com/tutorials/using-property-resolvers-and-attribute-processors/custom-property-processors).
90
-
The data with the parent and the overriden fields is kept serialized inside the asset's metadata, set in unity with `AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(targetObject)).userData`.
102
+
103
+
The data with the parent and the overriden fields is kept in a library object located at `Assets/Plugins/SOVariant/Editor/SOVariantDataLibrary.asset`
104
+
105
+
<pstyle="color: grey";>Before 2.0.0:
106
+
<strike>The data with the parent and the overriden fields is kept serialized inside the asset's metadata, set in unity with `AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(targetObject)).userData`.</strike></p>
91
107
92
108
## Installation
93
-
> Requires [Odin](odininspector.com/) to be installed before adding the package
109
+
> [!WARNING]
110
+
> Requires [Odin](odininspector.com/) version `3.2.1.0` to be installed before adding the package.
111
+
112
+
> [!WARNING]
113
+
> This package is maintained for Unity version 2022.3.16f1 LTS.
114
+
94
115
### Using Unity's package manager
95
116
Add the line
96
117
```
@@ -109,6 +130,21 @@ the package will be added as a scoped registry, which you can inspect under `Pro
109
130
### Alternative
110
131
Download and copy all files inside your project.
111
132
133
+
## Upgrading to 2.0.0 from previous versions
134
+
135
+
In version `2.0.0` of the package, the data moved from within each object's metadata to using a Scriptable Object library.
136
+
Unity's importer being too unstable, reading and writing the data to the metadata became too complicated and often led to errors and failures.
137
+
138
+
If you were using the package pre-`2.0.0`, a tool has been written to migrate to the new version.
139
+
Run `Tools/GieziTools/SOVariant/Upgrade user data to new version`.
140
+
This will read all data contained in the metadata and build the library.
141
+
If necessary, you can run `Tools/GieziTools/SOVariant/Fix SOVs`.
142
+
This will loop through each object and rebuild the parent/child relationship, as well as propagate the parent values to the children.
143
+
Because the previous version of the tool was quite unstable, this step is highly encouraged
144
+
Additionally, you should check the data to make sure each object has the right values.
145
+
146
+
This new version should fix a lot of the issues that appeared with newer versions of Unity and with the package being unstable.
0 commit comments