Thank you so much!
May I ask a few quick questions for the custom editor window that I create with Odin:
1 - Custom context menu is awesome but I don’t want to allow copy paste, copy to clipboard and set null, which breaks the whole system if it is used accidently which comes as default I have to disable them because I have a complex editor system which has lots of nested objects, list inside table list inside another list etc. and I need to allow only my custom context menu which has delete and rename only for some sections… [DisableContextMenu] attribute is disabling all context menu, is there any option to disable it for some properties without losing my custom context menu? also applying for every property in a class is really annoying is there a disable option for the whole class but allow only for some field/properties…
2 - How can I refresh the editor to update the changes immediately because till I move my mouse it doesn’t update with some attributes such as [OnValueChanged] I have a workaround though I call Editor.Forcus() func when I complete my run in the func is there any better option, am I missing something?
3 - Is there any chance that you can implement a horizontal list like table list but rather than vertical, it draws the elements horizontal next to each. I was making a translator window and since there was a limited amount of languages (only the major languages) I have created a field for each other, that’ll do for me for now so I ask for future implementations whether you can achieve something like this or not…
4 - This one is more of a suggestion actually, can you implement a horizontal line (draws a colorful line only) and a [SingleEnumSelect] attribute which allows only one selection for flags enums rather than multiple… I have implemented my own attribute which works quite well but I guess since it is very easy to implement you can add two more useful attribute to your system which I’m a huge fan by the way I have started a few days ago and it is a must have when we consider how terrible unity’s custom editor system, it makes it much more fun and organized… I’m always against the 3rd party assets which I never use to not have a dependency on them because I don’t trust for stability and long term support but since this is an editor asset not runtime I have tried for the first time and this is very well documented and well organized although it needs some improvements for some advanced customizations but still very very good.
The first question what matters the most actually the others just nice to have
hello eveyone,a stupid question here,
Can I use odin without attributes workflow?because I don’t want to add editor attributes to my runtime code.
I mean is there anyway that i can write a editorwindow class and call odin’s ui component?
A lot of Odin’s more complicated drawers do not have simple methods that you can just call to draw them, so at some point in the process you’re always going to use attributes. Odin has something called AttributeProcessors that allows you to apply attributes to your members programatically which makes it possible to separate your runtime code from your editor code while still using attributes.
Hi there, Didn’t find the answer in thread.
Is there a way to display an animation / clip preview in an Object Preview (or anything) ?
This is what I get so far :
Saw that this asset has issues working with nested prefabs, what are the limitations of odin inspector’s compatibility with nested prefabs? What can’t I do and how is the nested prefab workflow affected by Odin’s lack of support?
I got Odin before knowing this and am wondering if this asset is of any use since I very much like to use nested prefabs.
Odin Inspector works perfectly fine with nested prefabs, it’s Odin Serializer that does not.
This means that if you use one of Odin’s serialized classes like SerializedMonoBehaviour or SerializedScriptableObject you may get weird and unexpected behaviour with prefabs. If you use Unity’s default serialisation you should be fine. We’re also currently working on a solution to this that could reintroduce full support for prefabs, there is no guarantee since we tried it a few times without success, but it seems to be promising so far.
hi, I have some class Use unity CustomEditor but want to Drawn by odin. How should I Do?
And I not want to change the class Editor Becouse It’s from third party Plug.
Hi, I just get started with Odin inspector, I’ve tried some attribute in the documentation, But I just encounter a problem.
None of any attribute work as expected within non monobehavior class at all. But work just fine in when I use them within mono class. Here are some pictures.
I’m currently using Odin v3.1.9, will this bug gone if I try update the package? Also do the class still serializable without
[Serializable] attribute or there are other ways around?
I think (but don’t know) Odin sees the Serializable attribute and decides that Unity should be responsible to serialize this class. At the same time, it is part of a SerializedMonoBehaviour which is drawn by Odin. I am not sure if the class is actually serialized by Unity then. At least it is not correctly drawn by Odin.
Odin Serializer will be able to serialize the class without that attribute. Other serializers might ignore it.
Anyway, I just tell you my observations and my best guesses about the technical details. I guess @Schwapo or an Odin developer can give you a better answer here (I’m also curious).
Odin is using [CustomEditor( typeof( Object ), true )] to handle a number of custom things, I think including the Button attribute which is conflicting with some custom editors of our own. Is there any way to get them to co-exist? We could even create a base class with events and have Odin subscribe to it or something similar
Odin does not in fact use that approach - though in practical effect it does do something similar. Odin decides itself which types it wants to draw, and then it directly injects itself into Unity’s internal editor mappings to set itself as the editor for all types it wants to target. It just so happens that the setup of things Odin will choose to inspect by default looks a lot like a [CustomEditor(typeof(Object), true)] setup - if Odin detects that a type already has a custom editor, Odin will respect that and leave the type alone so as not to interfere with its custom drawing.
What you can do to implement Odin is inherit from OdinEditor instead of Editor if Odin is installed, checked via for example a preprocessor directive like #if ODIN_INSPECTOR - then all the base editor drawing methods such as OnInspectorGUI will draw Odin’s inspector instead of Unity’s default.
Odin lives inside the plugins folder where my dll/framework is inside packages so it will always work above mine. I guess your suggestion might work but since the default result is that it does actually not recognize my class currently unless there’s a setting somewhere?