Skip to content

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

  1. Add an Image or RawImage component to a UI GameObject
  2. Assign a sprite to the Image/RawImage to display your minimap background
  3. Add the MapFogOverlayUI component to the same GameObject
  4. 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