Create different camera layers to render things
Create 3 camera's with the following hierarchy:
- Set all camera's to "Clear flags = Depth only"
- And set the depth of the camera's in the inspector as follow:
Main Camera: Depth = 0
Gui Camera: Depth = 1
Gui Particle Camera: Depth = 2 - Now you have to create a layer for the GuiParticles:

- And assign your particle effect to this layer.
- In you inventory canvas change the render mode to "Screen space - Camera" and drag your GuiCamera to the "Render Camera" field.
- Change the layer of your inventory canvas (recursively) to "UI"
- Now finally set the culling masks for each camera as follow:
Main Camera: Everything BUT "UI" and "Particles"
GuiCamera: Nothing BUT "UI"
GuiParticleCamera: Nothing BUT "Particles" - You now have 3 render layers with each their own camera. All stuff marked as layer "Particles" will now be rendered in front of the "UI" layer.
Source: http://answers.unity3d.com/questions/1169898/hi-guys-i-need-some-help-with-gui.html#answer-1169946

No comments:
Post a Comment