Moxid
January 19, 2021, 5:02pm
1
Hello dear friends,
i have a custom editor script for my scriptableObject and i am doing this:
targetscript.go = (GameObject)EditorGUILayout.ObjectField(new GUIContent(“Go”, “Event GameObject”), t.go, typeof(GameObject), true);
it works great and i am able to drag drop my scene gameobject into the field but when i restart unity the field is empty. i was trying to fix this for the last few days. thanks.
You cannot refer to items in the scene from an asset on disk and persist that to disk.
The reason: the scene is transiently loaded and unloaded, so there is nothing to persist.
You can point to other asset objects (such as prefabs) on disk however.
Moxid
January 20, 2021, 2:25pm
3
Hmm that is bad news, wish it was possible because i want to make my asset user friendly, otherwise it is not such a clean soloution.