- Unity Game Optimization
- Dr. Davide Aversa Chris Dickinson
- 100字
- 2021-06-24 12:13:08
Moving common data into ScriptableObjects
If we have a lot of different Prefabs with components that contain a lot of properties that tend to share data, such as game design values such as hit points, strength, and speed, then all of this data will be serialized into every Prefab that uses them. A better approach is to serialize this common data in a ScriptableObject, which they load and use instead. This reduces the amount of data stored within the serialized file for the Prefab and could significantly reduce the loading time of our scenes by avoiding too much repetitive work.