![]() ![]() ![]() Therefore, 10 instances of that prefab would store 10 references to the same object (and not the actual data), occupying about 4MB only. If instead of declaring the array on the prefab’s script you had a reference to a ScriptableObject which contains the array, all the instances would point to the same data. That happens because the array lives on the script itself, and copying the prefab copies the script, hence the array. If you store an array of integers that occupies about 4MB in a prefab and you instantiate that prefab 10 times, you would have a copy of the array in each prefab’s instance, occupying a total of 40MB. if any objects are instantiated at runtime, then you will have to play. This problem (although not listed on the previous article) is exactly the same discussed in the Unity documentation about Scriptable Objects. I have a requirement to automate the creation of X amount of scriptable objects from a CSV file, in the image below is an example of a manually completed one, the minimum amount of automation I need for this is the name/description/stat modifier. find the controller script in your scripts folder, if you right click that script and select find references in scene this will show/filter all the gameobjects that are currently in your heirarchy that has this script attached. From saving memory, enabling configuration-driven games, and more Join this channel and. ![]() Public class MyDatabase : ScriptableObject Īnd this simple change should get rid of the error and let you use more than 7 depth levels of references. In this tutorial video you'll learn about some of the awesome things you can do with ScriptableObjects. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |