Just as I was about to start development for a plugin that would allow me to disable parts of a CUA, I stumbled over the collection by unique, uploaded by @trety. I played a bit with this set of plugins and got the feeling that a lot of the functionality (not all, though) could be integrated into a single plugin. So, after some coding and looking at other CUA related scripts like the one of @Sally Whitemane, lo and behold... I present to you: CUA_Editor

Add the file "CUA_Editor.cslist" to any CUA in the "Plugins" tab and you can enable/disable (also via scripting)
  • any GameObject (including all components like mesh renderer and colliders, as well as linked objects in the hierarchy),
  • one or more mesh renderers,
  • one or more colliders,
  • light sources,
  • audio sources,
  • light probe groups,
  • reflection probes.
The example scene demonstrates some of these aspects:

The plugin is initially off, so the CUA is fully there. When turning the plugin on, the blue GameObject, already set to disabled, will vanish. The red toggle now also works for the red GameObject.

CUA_Editor_Step1_PluginOff.jpg
CUA_Editor_Step2_PluginOn.jpg
CUA_Editor_Step3_GameObjectOff.jpg


The two toggles below address only the renderer / the collider components of the black GameObject.
Removing the renderer makes the black parts invisible, but leaves the collider, so the blue sphere will stay where it is initially.
Removing the collider will cause the blue sphere to move to it's target position which is intersecting the black handle, but the "visible" part of the handle stays.

CUA_Editor_Step4_RendererOff.jpg
CUA_Editor_Step5_ColliderOff.jpg


The plugin UI is fairly compact and self explanatory. The top left "Filter" section has a drop-down to choose which kind of CUA components you are dis/enabling. You can also enter a name (or a RegEx if you know the power of those) and get only the elements filtered by name, e.g., to search for everything with "tree" in it. Also, since v1.4, hovering over a toggle will make the corresponding GameObject flash, and it's bounding box will appear (e.g., in the screenshot below, the red pillow named Cube.023).
CUA_Editor_UI.jpg

Depending on the design of the CUA, the names in the toggles can get very long, but the UI will (within reason) adapt by changing the font size. You can also click "Copy CUA Structure to Clipboard", and it will log the whole CUA structure tree to the console and copy it into the clipboard, so you can use an editor to look at the data in detail.

"Enable/Disable All" applies to all toggles currently listed on the page.

Then there are two "Destroy" options, which theoretically should delete the disabled GameObjects to totally remove them from the game engine and theoretically gain some FPS. In practice, I have noticed that after a "Destroy", the next scene load will stall indefinitely, so something is still off, and I recommend NOT using a) the checkbox "destroy on load" and the "Destroy Disabled GameObjects" button!!!!!!!!

Known Bug:
  • (Not really a bug, but something to keep in mind): When pressing "Rescan CUA", after having edited/toggled elements (for which there should actually be no need to), saving the scene will NOT save those edited elements (as the rescan will make the plugin think, those settings are the new default, and only toggles that are different from the defaults are saved).
    In order to reset everything without losing your changes, click "Save Configuration to Clipboard", briefly choose "None" as a CUA, then the correct CUA again, and click "Load Configuration from Clipboard".

Credits:
Thanks to unique / @trety and @Sally Whitemane for their CUA plugins that served as code "seedlings".
Thanks to @TacoCat for the TCCarchive, from which I borrowed one of the smallest CUAs I could find to a) not create any dependency and b) not blow up the VAR file too much.
Thanks to @MacGruber for the bread-and-butter code Utils.cs and LogicBricks.
Author
HAL9001
Downloads
9,418
Views
12,480
Packages
1
Total Size
1.18 MB
Version
v1.5 (var 8)
First release
Last update
Rating
5.00 star(s) 12 ratings

More resources from HAL9001

Latest updates

  1. v1.5 (var 8): Bugfix for parented CUAs

    I noticed that the plugin failed to even initialise ("Unable to find CustomUnityAssetLoader to...
  2. v1.4 (var 7): Another tiny bugfix

    And another Argh... left a debug print in the code that would dump the structure to the info...
  3. v1.4 (var 6): Minor bugfix

    Argh, a minor bug that did not properly remove "(Clone)" from a game object name slipped through...

Latest reviews

This is literally a game changer for me, as I use vam for the game I'm making, and often have scenes I can't use due to placement of objects in an asset. Thank you so much!
HAL9001
HAL9001
You're welcome :-)
Upvote 0
Absolutely a must have! I use it pretty much every time I make a scene.

The new feature that highlights what is being selected is incredible. It makes things SO MUCH faster and convenient.

Thank you for this!
HAL9001
HAL9001
I was hoping that what works for me would also work for others. Glad it does :-)
Upvote 0
So useful! Thanks! Highly recommended.
HAL9001
HAL9001
You're welcome :-)
Upvote 0
Thank you - precisely the utility I required. Invaluable.
HAL9001
HAL9001
Good to hear :-)
Upvote 0
Cannot thank you enough for this AND for sharing!
HAL9001
HAL9001
You're welcome. Glad it's of help.
Upvote 0
This is amazing. There were many assets which I discarded in the past because they had unwanted parts or wouldn’t fit to the scene. Just tested this plugin and it does a really good job editing those assets. Thank you
HAL9001
HAL9001
That's exactly why I wrote this plugin in the first place.
Upvote 0
nice
HAL9001
HAL9001
Thanks :-)
Upvote 0
WOW! I kid you not, I had been working on a scene for months now, and just recently needed to edit the room it takes place in, to remove a piece of it. This worked PERFECTLY for that. Thanks you so much, this couldn't have been better timed XD
HAL9001
HAL9001
Glad to make others' lives easier, too :-)
Upvote 0
Boom.... Thank you so much
HAL9001
HAL9001
You're welcome :-)
Upvote 0
maaaaaaaaaa you are a genius, black magic
100000 thx , for the ligths i works too ? i not try all the function sry
HAL9001
HAL9001
Thanks for the feedback. Theoretically, yes, disabling lights (there's a filter option for that, too) should work - but I haven't tested it.
Upvote 0
Back
Top Bottom