upm add package dev.upm-packages.camerastackhandler
Note: upm
command is provided by this repository.
You can also edit Packages/manifest.json
directly.
{
"dependencies": {
// (snip)
"dev.upm-packages.camerastackhandler": "[latest version]",
// (snip)
},
"scopedRegistries": [
{
"name": "Unofficial Unity Package Manager Registry",
"url": "https://upm-packages.dev",
"scopes": [
"dev.upm-packages"
]
}
]
}
As of Unity 2019.3.7f1, the Verified version is v7.1.8, so you'll need to expand the ▶ to the left of the Universal RP to find the latest version.
- Select
Overlay
toRender Type
field ofCamera
component. - Add
AddOverlayCameraToCameraStack
component.
AddOverlayCameraToCameraStack
component will findOverlay Camera
automatically from same GameObject on runtime. You can also setOverlay Camera
manually.- Set field automatically when component attached (and invoked Reset).
- Overwrite
Render Type
toOverlay
on runtime ifOverwrite Render Type
field is set totrue
.
Add Overlay Camera into Camera Stack of Base Camera automatically.
The base camera to be added is selected with the highest Priority value.
This is directly due to the process of adding a Camera managed by the AddOverlayCameraToCameraStack Component to the Camera Stack of Base Camera.
When looking for a Base Camera to add, you can use Camera.depth
(the value that appears as Priority in the Inspector.) values in descending order, the first one is used.
Therefore, it is recommended to set a large value in Camera.depth
to fix the camera to be added correctly.