I use [GenerateAuthoringComponent] for my component data, however this data which is set in the inspector at editor time, does require visual feedback with Gizmo rendering at editor time (to visualise waypoint locations, and so on).
Is there a modern, simple way of doing this?
Lots of outdated, archaic and frankly bizarre solutions exist out there for what should be a simple procedure. Please help!
Also bonus bug: subscenes don’t render gizmos / handles …
Hitting myself on all sorts of usability corners while I’m hungry to get making a live game in Entities!
What’s wrong with using IConvertGameObjectToEntity to convert and still have a normal MonoBehaviour to work with in the editor? I never use GenerateAuthoringComponent because i need to optimize the data for runtime and rarely convert components 1:1 in the first place.
Gizmos do not work when a subscene is closed as at that point there are no MonoBehaviours loaded anymore. The only way to get Gizmos is to use a MonoBehaviour with IConvert, [GenerateAuthoring] does not work.
Instead gizmos, maybe is worth to try different tool.
For example ALINE asset allows to render stuff using DOTS (Jobs + Burst. Not Entities required). https://assetstore.unity.com/packages/tools/gui/aline-162772
Side note, latest version my not work with Unity 2021. Need to ask author for 1.4 version.
In my older project, I didn’t mind using MB with authoring components.
For me was simple and intuitive to work with.
Thank you for all your replies guys. This has got me thinking.
The subscene is definitely loaded, but the monobehaviour is still not running it’s OnDrawGizmos. I have to pull the object out of there in order to see it. This is with IConvertGameObjectToEntity
Edit: I think this thing is fixable Unity’s side, I mean I can just load the subscene directly (so I am only working in a single scene) and work in there but it is inconvenient.
Feedback to Unity: Quite happy with IConvertGameObjectToEntity worklflow… GenerateAuthoringComponent misled me and made me fight the API until I realised it’s one or the other.
The SubScene being loaded is not enough, it has to be opened for editing (using the checkbox in the hierarchy or the open button in the SubScene inspector) is what I meant. That is the only point where GameObjects are present and therefore the only moment when gizmos work.
Because of that I use gizmos only for validation purposes (eg. is the placement correct, are anchors blocked etc.) and debug drawing during runtime for debugging.
I can highly recommend the ALINE plugin that was posted here, has some quirks but the ability to debug draw text is sooo useful on its own and it works from jobs :).
Yeah there is several ways to covert gameobjects and they all have there uses including GameObjectConversionSystems. Hopefully Unity won’t depreciate any of them for only subscenes.
That’s exactly my situation though. I think it is a bug. The tickbox is ticked. It’s confirmed as loaded and open. Stuff just will not draw unless it is removed from that open and loaded ticked subscene.
Thanks, I see now. That’s extremely useful - I can just switch back to authoring mode. I did suspect it was a world-when issue but nice to see that I can work effectively again by using scene mode authoring view.
It makes sense but it’s not intuitive for newcomers at first glance so it’s a welcome addition to future docs to cover that behaviour I think. I wouldn’t call it a bug any more.