- Home /
How to emulate the 'Script' field in a MonoBehaviour, to change the type
The default inspector, for every script, will draw a 'Script' field, which when selected, opens a window to allow the script type of the component to be changed. Using this method, if the source and target scripts share some fields, it will automatically copy them over, which is superb.
I have two problems, really: Firstly, I can't find a way to draw this field using a custom inspector.
Secondly, I'd like to be able to change the type directly using an editor script.
Anything you have, I'd greatly appreciate
Your answer
Follow this Question
Related Questions
Why is my MonoBehaviour never being deleted? 0 Answers
Monobehaviours & Editors with Inheritance across DLL boundaries don't load into Unity 2 Answers
How can I reference a specific script inside a GameObject from another MonoBehaviour. 2 Answers
Get OnMouseUp event in other object's script 1 Answer
Quick question about GetComponentsInChildren< MonoBehaviour >() 1 Answer