EditorWithSubEditors from AdventureGameTutorial
There is a tutorial project - Adventure Game Tutorial. It is not very simple.
There you can use Scriptable objects to keep data between the scenes.
You can add gameObject to a scene and add to that object script "ReactionCollection.cs", so now you can put on it any scriptable object like "Condition reaction", "Text reaction" and so on. Yes, you can do i while you select an object from Hierarchy, but if you select any PREFAB and try to add any reaction collection to it, you will get the error
"NullReferenceException: Object reference not set to an instance of an object ReactionCollectionEditor.SubEditorSetup (.ReactionEditor editor) (at D:/Unity3D/Adventure Game Tutorial/Assets/Scripts/Editor/Interaction/ReactionCollectionEditor.cs:60) EditorWithSubEditors`2[TEditor,TTarget].CheckAndCreateSubEditors (.TTarget[] subEditorTargets) (at D:/Unity3D/Adventure Game Tutorial/Assets/Scripts/Editor/Abstracts/EditorWithSubEditors.cs:33) ReactionCollectionEditor.OnInspectorGUI () (at D:/Unity3D/Adventure Game Tutorial/Assets/Scripts/Editor/Interaction/ReactionCollectionEditor.cs:70) UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1245) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)"
I try to understand how to make this script work not only in Hierarchy window, but in Project window also! Can somebody help me with it?