Hi,
I’m having a small conceptual problem with SO’s. If I create an SO like thus…
[CreateAssetMenu(menuName = "Node / Archetype")]
public class NodeTypeArc : ScriptableObject
{
public string Test;
}
I then generate, via the asset menu, a number of instance of this SO, eg. “Utility”, “Corporate”, “Government”, “Research”, which all appear in the Project view.
I understand that I can then drag and drop these instances across to a Monobehaviour script in the Inspector anywhere I have a public NodeTypeArc instance.
Q1: All good but is there a way to directly access the specific SO instances, eg. “Corporate”, from code?
I realise I can easily do this…
node.instance = ScriptableObject.CreateInstance<NodeTypeArc>();
but that doesn’t get me the “Corporate” SO instance that I’m after.
Q2: Would I be correct in thinking that what I want could only be done by deriving from my NodeTypeArc SO class?, eg.
public class Corporate : NodeTypeArc
and then doing this…
node.instance = ScriptableObject.CreateInstance<Corporate>();
If somebody could point me in the right direction here it’d be appreciated.
Cheers,
Cameron