- Home /
Reference a script from Editor folder
Is it possible to create a reference to a Monobehaviour script in the Editor folder?
Answer by AmatuerProgrammer · Nov 28, 2017 at 06:36 AM
What I do and so does a large number of people; Create an empty GameObject and attach all scripts that aren't specific to an object in the scene to that empty object. This way whenever you want to access these scripts you can just reference this empty GameObject.
Answer by JeffHardddyyy · Dec 20, 2016 at 06:13 PM
To create a reference?
According to wiki.unity3d, "The Editor folder name is a special name which allows your scripts access to the Unity Editor Scripting API"
Now to my understanding, you can't. For The Editor Folder is allows your scripts to gain access to the Unity Editor. Because if we were to get a standard C# Script, By Default, the public class defines it as a MonoBehavior. And by default the Editor makes it a Editor. If you reference a MonoBehavior in a Editor script, It becomes a MonoBehavior
I may be wrong, stuff like this I'm not the best at, But I tried getting you a answer as soon as possible just so you can keep working.
Good Luck
Your answer
Follow this Question
Related Questions
Initialising List array for use in a custom Editor 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Reference creator of gameObject 1 Answer
How to add a reorderable list on CUSTOM EDITOR WINDOW? 0 Answers