These Assets exist as a singular Asset in the database. Sort of just a collection of data to be used.
For example, I could have
public class ItemType : ScriptableObject {
int itemName;
int itemWeight;
}
Then create an Asset from ItemType…rename it to “Pistol” and set the itemName and itemWeight. My “Pistol” asset now carries around these standard values whenever I reference it from anywhere in the project.
The Asset can be copied and used if needed. Otherwise, any change to the Asset reference from any component will result in the Asset itself changing.
I can use this to store instances of items in an inventory system such as…
public class ItemInstance {
ItemType itemType;
public int itemID;
}
//inventory component attaches to any GameObject that will carry items
public class Inventory : MonoBehaviour {
List<ItemInstance> itemInstances = new List<ItemInstance>();
//Add items by creating new Iteminstances of ItemType with their own unique ID
}
Does anything like this exist in UE4?