Lua Script Wizard for Custom Editors

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Crabman
Posts: 9
Joined: Mon Sep 07, 2015 2:52 pm

Lua Script Wizard for Custom Editors

Post by Crabman »

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?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lua Script Wizard for Custom Editors

Post by Tony Li »

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.
Crabman
Posts: 9
Joined: Mon Sep 07, 2015 2:52 pm

Re: Lua Script Wizard for Custom Editors

Post by Crabman »

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?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lua Script Wizard for Custom Editors

Post by Tony Li »

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.
Crabman
Posts: 9
Joined: Mon Sep 07, 2015 2:52 pm

Re: Lua Script Wizard for Custom Editors

Post by Crabman »

Makes sense. Thanks for clearing that up.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lua Script Wizard for Custom Editors

Post by Tony Li »

My pleasure!
Post Reply