Unit System
  • WELCOME
    • πŸ‘‹Hello
    • πŸ—ΊοΈRoadmap
    • ⛑️Support & Community
    • πŸŽ“Version - Changelog
  • Getting Started
    • πŸ”ŒImport Package
    • βš™οΈConfiguration
    • πŸ” Database
    • πŸͺŸManager Window
    • Creating a new Scene
      • Player Camera
      • Set up Player
      • Set up Player UI
      • Set up the Game World
    • Create Units
      • Resource (Crystal)
      • Research (Crystal age)
      • Resource node (Crystal Node)
      • Resource collector (Crystal)
      • Combat unit (Mage)
      • Production unit (Mage Tower)
      • Faction (Purple Cubes)
  • How it works
    • Overview
    • Modules
      • Resource
      • Production
      • Population
      • Garrison
      • Collection
  • Integration
    • Unit Selection
    • Unit Formation
    • Object Placement
Powered by GitBook
On this page
  • Overview
  • 1. Selection & Units
  • 2. Sync Player Selection
  1. Integration

Unit Selection

Guide on how to integrate Unit Selection with Unit System entities.

PreviousCollectionNextUnit Formation

Last updated 15 days ago

Overview

This page is for guiding you through the process of basic integration for package. Refer to the if you need more information.

1. Selection & Units

For scene unit selection to work, you only need these two things:

  • Selection System prefab in scene and configure it (and it's visuals)

  • SelectableUnit and additionally ManagedUnitObject components to your units.

Now this will already work for selecting and highlighting units by the player. However since this is a separate package, we need to connect selection and interaction for the player.

2. Sync Player Selection

If you are manually managing interactions and UI for selected units, you can skip this step.

However if you are using provided Player UI prefab, then EntitySelectionManager is used to communicate selection changes to those scripts. For this we have provided 2 basic scripts that simplify the integration process.

Find and add Player Selection (Unit Selection) prefab to your scene. This includes:

  • PlayerUnitSelectionManager script which replaces EntitySelectionManager. This manages the communication between the EntitySelectionManager interface and UnitSelector to make sure the data is synced.

  • Additionally we have 2 scripts for filtering selection, both may be removed if undesired:

    • MultiSelectionFilter script for basic Strategy filtering behaviour, this restricts multi selection to only owned units of the player; when dragging to select multiple units, only owned ones are selected. Does not impact single selection behaviour.

    • UnitStructureSelectionFilter script, similar to the previous one it filters out units with buildable capabilities on multi-selection, but only when non-building is present. This means that drag to select can select buildings, as long as there is no other unit present in selection. Otherwise those units will be prioritised.

Selection System
Selection Guide
Selection components on Unit
Player selection components