N
N
NickName73312018-09-10 21:07:54
C++ / C#
NickName7331, 2018-09-10 21:07:54

Unity - how to get a reference to a scriptableobject?

I need to get a link to the scriptableobject I need, for example, according to some parameter that I specified to it. How can I do that? (For example, a scriptableobject has a parameter of its ID and I need to know its other parameters from its ID)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Basmanov, 2018-09-11
@NickName7331

Put ScriptableObjects in Resources folder, load with Resources.Load by line with ID. Or you make a public array on some script and add all the objects into it, and then search through the array to get the one you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question