Scriptable Object references if not saved in AssetDatabase?


Suppose I have a reference to a scriptableObject in my Monobehavior.
This scriptableObject was created through the Editor script.

question 1:
What happens if I don’t save the scriptableObject as an asset into the asset database after I instantiate this scriptableObject?

question 2:
Will unity keep the reference to a scriptable Object which was in the Project panel after the game build? Or do I have to manually re-fetch it through “Resources.Load”? What if the Monobehavior is a part of a prefab and is not in the scene?

1: Any asset file created is added to asset database, if you don’t save the ScriptableObject in a file it will not be usable at runtime.

2: If an ScriptableObject reference is set before game build you will have no problem, any thing made after game build will not be in the game, you will need rebuild the game.