I just tried writing a property drawer (popup to show animator variables) and I was surprised that you don’t have support for property drawers! – I mean yes, I can override the GUI for the task, but not for the individual fields. I noticed you’re totally overriding the way Unity would normally draw a MonoBehaviour (in DrawDefaultInspector) – It’s fine as long as I can still use property drawers… I have tons of PDs I really can’t live without. Hope you understand my need and really consider adding this feature in next updates!
Sorry for no PropertyDrawers support. There are some definite good reasons why I’ve overriden the inspector like that, although PropertyDrawers seems one drawback. I will see to somehow support PDs in a future release.
I might attempt to give it a shot on my own if it’s not on your schedule. Could you please tell me a bit about those ‘good reasons’? (just so I be on the look-out)
Another reason why you might want to add property drawers is, take a look at this situation:
1
2
3
4
5
6
7
8
[Serializable]
publicclassEyes
{
publicBBFloat fov,distance;
// etc...
}
Now put a reference to an Eye in a Task, the Eye would be drawn OK just like any other serializable class with a foldout and all, but if you collapse it to see how fov and distance are drawn, they’re not gonna be drawn the way you want them – they’ll also be drawn with a foldout that if you collapse you’ll get ‘value’ and all the rest of the stuff that’s in a BBVaraible…
This problem is avoided if you’d used a PropertyDrawer to draw your BBVariable stuff.
One of the good reasons is that I wanted to be able to show automatic inspectors for any object type even for those that do not derive UnityEngine.Object or live on a UnityEngine.Object.
If you take a look at EditorUtils.cs at ShowAutoEditorGUI, which is responsible for starting an inspector, you will see that the parameter is a System.Object.
Furthermore the GenericField (which shows a single entry) function directly bellow the ShowAutoEditorGUI also takes a System.Object as a parameter along with a Type which there are many cases in NC, in which the type provided there is not the same as the type of the value.
In the end it’s about having full control.
If you want to experiment on your own, you can start doing so in the ShowAutoEditorGUI 🙂
By the way, the example you posted with the ‘Eye’ class, if you use an Eye field in a Task, the BBFloats within will be drawn correctly. They will indeed not draw correctly if you use the BBFloat in a typical Monobehaviour inspected by Unity, but BBVariables are to be used in Tasks and Nodes.
In any case, I know what you are talking about, and I will see to supporing PDs somehow.
Cheers
Join us on Discord: https://discord.gg/97q2Rjh
Author
Posts
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.