Purpose

Command agents with basic real-time strategy (RTS) control type input. Displays a selector marquee in a specified color, with selected agents displaying a circular icon at their base. 

How to Use

Drag-select single or multiple agents by left-click, and then direct agent(s) to a waypoint on the plane designated by right-click of the mouse. Agents will navigate around obstacles to reach a set waypoint and stop. Navigation of agents can be interrupted by another right-click of the mouse; agents will then navigate to that new waypoint location.

Scene Location & Name

Assets/Ride/Examples/AgentCommands/ExampleAgentCommands.unity

Setup Requirements 

Utilize the commands and selector API for your scene and its agents by adding the ExampleAgentCommands script and SelectorUI prefab. 

ExampleAgentCommands Script

First, add this script to an object in your scene to enable the RTS type of unit command. 

SelectorUI Prefab and RectSelectionDisplay Script

Next, import the SelectorUI prefab into your scene to enable rectangular selection and highlight of units by way of the RectSelectionDisplay script.

This prefab also contains the necessary EventSystem and Canvas child prefabs. 

Scroll Up