Exemplo n.º 1
0
    public void Setup(Vector3 targetPos, List <Unit> newUnitList, GroupFormation.Type formationType)
    {
        _targetPos = targetPos;
        _unitList  = new List <Unit>(newUnitList);

        _groupFormation = GetComponent <GroupFormation>();
        _groupFormation.SetUpFormation(formationType, _unitList.Count);

        transform.position = FindCentroid();
        _maxSpeed          = ComputeSpeed();
        GetComponent <Movement>().UpdateGroupSpeed();

        foreach (Unit unit in _unitList)
        {
            unit.GoToGroupFormationPosition(this, transform.position);
        }
    }
Exemplo n.º 2
0
 public void ChangeFormation(GroupFormation.Type type)
 {
     _groupFormation.ChangeFormation(type);
 }