What I'm looking for is something similar to the "Render Paths" view in Unity's scene view, only with my own color-coding: The ability to give certain objects a custom color overlay in the scene view.
It would be great to use as visual feedback for level design tools.
Any idea if Unity provides such a feature or how I could achieve something similar without changing every object's material?
Answer by jonas echterhoff
Jul 05, 2011 at 06:57 AM
The closest thing you can get is to use Gizmos. See DrawGizmo.
OK, DrwaGizmo seems to be a good place to put such an effect. How would you suggest I color the objects though? Just tried to render a copy of every object in front of the actual object and give the copy a flat, transparent color, but that doesn't seem to be very practical (For one, they are visible in the game cameras. Editing the scene and keeping track of the debug objects is also tough). Adding materials to every object's materials array has the same problems and I haven't found a "ColorObject" Gizmo yet..
Answer by Bunny83
Jul 05, 2011 at 11:35 AM
If you want to draw some kind of overlay you could render the scene again with Camera.RenderWithShader. Take a look at the Replacement Shaders.
If you want to render the scene completely with your custom shader you should be able to use Camera.SetReplacementShader on the scene camera. To disable your render mode use Camera.ResetReplacementShader
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
To help users post good questions and use the site effectively we have posted a user guide. Please check it out.
Answers and Comments
4 People are following this question.
How to include custom art/styles in editor scripts
Custom scene view in editor window
2d mode through Editor Script
Modal Functionality in Custom Editor Window