Question d’entretien chez Games2Win

Have you used Scriptable Objects in your projects? Explain about them.

Réponse à la question d'entretien

Utilisateur anonyme

21 févr. 2025

A ScriptableObject is a data container that you can use to save large amounts of data, independent of class instances. One of the main use cases for ScriptableObjects is to reduce your Project’s memory usage by avoiding copies of values. This is useful if your Project has a Prefab that stores unchanging data in attached MonoBehaviour scripts. Every time you instantiate that Prefab, it will get its own copy of that data. Instead of using this method, and storing duplicated data, you can use a ScriptableObject to store the data and then access it by reference from all of the Prefabs. This means that there is one copy of the data in memory.