The Attack Warning Manager component allows to highlight areas in the minimap where the local player’s units/buildings are receiving damage from enemy factions
When you’re creating a new map using the RTS Engine menu editor, this component is attached to an object called “MinimapManager”.
- Minimap Canvas: Drag and drop the minimap canvas in this field, where the UI attack warnings are rendered.
- Minimap Camera: Drag and drop the camera that renders the minimap in this field.
- Prefab: The prefab that is cloned when a new attack warning is spawned. This prefab has the Attack Warning component (which doesn’t have any exposed fields) and the Effect Obj component attached to it. Making it an effect object allows it to be pooled efficiently using the Effect Obj Pool component:
- Code: Make sure that a unique code is assigned to the attack warning prefab.
- Default Life Time: This is the duration for which each attack warning will be displayed for.
- On Disable Event: Drag and drop the attack warning prefab and set the event to “Attack Warning -> Disable()”.
- Audio Clip: Played when a new attack warning is spawned.
- Show UI Message: When enabled, a UI message will be displayed for the player when a new attack warning is spawned?
- Min Distance: The minimum distance required between all active attack warnings. This allows to avoid spawning attack warning at the same or very close positions in a short duration.