Is there any way to access information from a ScriptableObject other than to drag in a reference into a Monobehaviour’s inspector field?
I have some database/global info type ScriptableObjects that are required by multiple different scripts. I was hoping I could avoid dragging in references to the SOs to all the different scripts that require info from them.
My current workaround is to have some static methods in the actual ScriptableObject and an Init() method that initializes the static vars that provide an interface to the internal info. I attempted to have the the initialization occur in OnEnable(), but it does not appear to be called at runtime…unless I select the asset corresponding to the SO in the editor.
So I have to drag in a reference to the SO asset into a Monobehaviour and call the Init() method manually. Then the other scripts can all access the static methods to access the info in the ScriptableObject.
Does anyone have any ideas?