Quantcast
Channel: Latest Questions by gdbjohnson
Viewing all articles
Browse latest Browse all 24

Creating an AssetList of Scriptable Objects

$
0
0
I was playing around a bit with creating asset lists and I noticed a curious behaviour that I wanted to understand a bit better. I have: [System.Serializable] public class SpawnItemList : ScriptableObject { public List itemList; } Originally, I made GameItem a scriptable object as well. When I created the asset using AssetDatabase.CreateAsset, I noticed that Unity allows me to expand the asset list, however it does not let me populate the items (in the Editor). Instead, I get a bunch of placeholders for GameItem, set to null. However, if I make GameItem a simple data container that does not extend ScriptableObject, then Unity instantiates the object, allowing me to enter in the data for GameItem. Why the difference?

Viewing all articles
Browse latest Browse all 24

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>