예제 #1
0
    public void selectBulkUnits(Vector3 startDrag, Vector3 endDrag)
    {
        clearSelectedUnits();
        RayBox rayBox = new RayBox(startDrag, endDrag);

        rayBox.drawBox();
        foreach (Collider col in rayBox.drawOverlapBox())
        {
            if (col.gameObject.GetComponent <UnitController>())
            {
                col.gameObject.GetComponent <UnitController>().isSelected = true;
            }
        }
        updateSelectedUnits();
    }