- Home /
Question by
LordDarkon76 · Jan 05, 2016 at 11:26 PM ·
scripting problemprefabeditorwindoweditorguilayout
Change script from EditorWindow
Hello World!
I'm doing an enemy editor with EditorWindow. All my enemies scripts derive from the same base class.
What is the best way to change the attached script to another? Also Is there a way that when you press the select button (circle) only the scripts with the same inheritance are show in the selection?
Note: Using EditorGUILayout.ObjectField and MonoScript allows me to select a script, but I haven't found a way to change the attached enemy script to MonoScript.
Also using EditorGUILayout.ObjectField typeof(BaseEnemy) only allow me to drag prefabs with the script attached not the script.
Kind Regards,
Comment