Attack Order

public class AttackOrder : Order

This class is used for attack orders for unit. It contains AttackTarget field, which stores target for attack of unit.

Example

// this example code running from Unit.cs component

Unit unit = this; // getting unit component, from which we run this code.
Unit enemyUnit = FindObjectOfType&ltUnit&gt(); // suppose that there we setting up Unit component of other unit.

AttackOrder order = new AttackOrder(); // creating new AttackOrder here
order.AttackTarget = enemyUnit; //  setting up enemy unit as attack target.

unit.AddOrder(order, false); // adding created order to unit orders list. Now unit will follow other unit.