Creating a ScriptableObject instance of a Created Asset
https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/scriptable-objects
I was following the tutorial above and it shows how to create an inventory item as a ScriptableObject and hooking into Unity's menu system to create these on the fly as assets. In the tutorial he makes a public object and assigns the inventory manually to the GameObject.
I want to be able to create a new ScriptableObject based on the Asset. For example if i create an Inventory item called "Broad Sword" and assign its properties (attack, cost, ect) then I want to be able to create a ScriptableObject of that BroadSword and not just a generic ScriptableObject.
So... you're saying you want to write a class that inherits from the ScriptableObject class?
Nope. You can create a class that inherits the scriptableobject, making it a scriptable object. But in Unity itself you can create Assets that are instances of that scriptable object. I want to be able to create one based off of that asset. I believe i have found the solution by using Resources.Load("path-to-scriptableobject-asset") but want to test it before providing my own answer.
Answer by chadmandoo · Oct 10, 2017 at 11:07 PM
If anyone running across this is looking for an answer you can use the following code:
MyScriptableObject myObj = Resources.Load('asset_name') as MyScriptableObject;