Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by JimmyJJeeter · May 12, 2012 at 08:15 AM · monodevelopassemblycustom-editorexternal-libraries

Editor scripts into external assemblies? how?

I have a class that I'd like to have a custom editor for. I have the class working in an assembly DLL ok. Now, how would I go about doing the custom editor? Can I put it into the same assembly? As I get it, it needs to go into (an) Editor folder, so do I have to have two assemblies, one for the main class, one for the editor? Or maybe there's some structure to the assembly itself? So confused!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dreugh · Oct 05, 2015 at 06:48 AM 0
Share

Hi,

Did you ever succeed with a custom inspector in an external assembly? I'm trying to do the exact same thing as you and can't find anything on how to do it.

Best regards

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by rutter · May 12, 2012 at 08:37 AM

This thread has some interesting reading.

That script you're hoping to write a custom inspector for, is it a Unity component type, such as a MonoBehaviour script? I haven't seen any working demos where those are loaded in from external assemblies -- Unity's serialization and so on don't usually play nice in that way -- but that doesn't mean it's impossible.

One suggestion from the thread I just linked was to subclass the external class with your own script, and attach the subclass as a component. If the class you're working with is not a component type, it may be acceptable to create a behaviour script which "manages" an internal instance, and have Unity work through that wrapper layer.

In any case, the basics of writing a custom inspector are surprisingly straightforward:

  • Extending the editor (manual)

  • Editor class (script reference)

  • CustomEditor attribute (script reference)

If you want a more specific answer, it may help to ask a more specific question.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JimmyJJeeter · May 12, 2012 at 08:43 AM 0
Share

Thanks, I have the class working just fine, it is $$anonymous$$onoBehaviour and it is now in an external assembly, works great. Thing is, I have a separate Editor script to manage a field change for this thing (I have to tweak some internals when a setting changes so it can draw its gizmos ok). It works fine, but is just a normal Editor script. Now I want to hide that Editor script into an assembly too. Eventual target is the Asset Store, so it would be nice to $$anonymous$$imize the number of files for delivery. If I could put the editor script into the same external assembly, that would be keen. I know Editor scripts can go into external assemblies, I just don't know if I need one assembly or two (one for editor, other one for main class).

avatar image rutter · May 13, 2012 at 07:37 AM 0
Share

Ah, I see.

I have to admit that my understanding in this area is not profound. If I had to guess, you'll probably need two assemblies -- any editor script will necessarily reference the UnityEditor namespace, which isn't included in published builds.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

After upgrading to 3.4 I sync Monodevlop and now I have 4 different projects in my solution 1 Answer

How to generate Assembly-UnityScript-firstpass.csproj ? 1 Answer

MonoDevelop C# Assembly problem: UnityEngine does not exist in current context. 1 Answer

UnityVS 1.8 possible bug with XML.Linq 1 Answer

How should I add references to additional Mono assemblies? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges