MapFogOverlayUI
The MapFogOverlayUI component renders the fog state onto a UI element, making it easy to display fog of war on a minimap.
Overview
MapFogOverlayUI is a standard MonoBehaviour that works with Unity's UI system. It reads the global fog shader properties set by FogOfWarManager and applies them to an Image or RawImage component.
The component requires either an Image or RawImage on the same GameObject.
Setup
- Add an
ImageorRawImagecomponent to a UI GameObject - Assign a sprite to the
Image/RawImageto display your minimap background - Add the
MapFogOverlayUIcomponent to the same GameObject - Configure the Inspector properties below
MapFogOverlayUI (Inspector)
| Property | Type | Default | Description |
|---|---|---|---|
| Unexplored Fog Texture | Texture2D |
null |
Tiling texture for unexplored areas on the minimap |
| Unexplored Fog Tint | Color |
(0, 0, 0, 1) |
Color tint for the unexplored fog overlay |
| Explored Fog Texture | Texture2D |
null |
Tiling texture for explored-but-not-visible areas |
| Explored Fog Tint | Color |
(1, 1, 1, 0.5) |
Color tint for the explored area overlay |