I'm looking to include the Lua Script Wizard in a custom editor and found this on my search. This class doesn't seem to be a part of the current version anymore, though.
Is there a quick and easy way to add the script wizard to a custom editor or would I have to recreate it myself?
Lua Script Wizard for Custom Editors
Re: Lua Script Wizard for Custom Editors
Hi,
It's still there. Make sure you've included the PixelCrushers.DialogueSystem namespace. As a test, you might create C# script files named TestLuaWizard.cs and (in an Editor folder:) TestLuaWizardEditor.cs containing the exact code on the page that you linked.
It's still there. Make sure you've included the PixelCrushers.DialogueSystem namespace. As a test, you might create C# script files named TestLuaWizard.cs and (in an Editor folder:) TestLuaWizardEditor.cs containing the exact code on the page that you linked.
Re: Lua Script Wizard for Custom Editors
Ok, it seems the problem is trying to access it outside of the Editor folder. When I create the test file within that folder, it works, if I copy it to the place where I store my scripts, it throws an error.
I'm defining the CustomEditor within the class that uses it, as I just want to change the way it shows in the inspector. I'm relatively new to fiddling with custom editors, so is this considered bad practice, do I need to create those scripts in the Editor folder or why isn't it possible to access those classes outside of it?
I'm defining the CustomEditor within the class that uses it, as I just want to change the way it shows in the inspector. I'm relatively new to fiddling with custom editors, so is this considered bad practice, do I need to create those scripts in the Editor folder or why isn't it possible to access those classes outside of it?
Re: Lua Script Wizard for Custom Editors
I'm afraid Editor scripts must be in an Editor folder. You can have as many Editor folders as you want, though. People frequently create an Editor subfolder inside their Scripts folder for editor scripts.
Unity compiles scripts in Editor folders into a separate assembly (DLL) than your regular project assembly. This way they're excluded from builds. When Unity looks for custom editors, it only looks in the editor assembly.
Unity compiles scripts in Editor folders into a separate assembly (DLL) than your regular project assembly. This way they're excluded from builds. When Unity looks for custom editors, it only looks in the editor assembly.
Re: Lua Script Wizard for Custom Editors
Makes sense. Thanks for clearing that up.
Re: Lua Script Wizard for Custom Editors
My pleasure!