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();
    }
Beispiel #2
0
    private void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Debug.LogWarning("Instancia de box manager ya existe, borrando esta...", gameObject);
            Destroy(gameObject);
            return;
        }
        Instance = this;
        if (player == null || box == null)
        {
            Debug.LogWarning("Player o Box nulos!");
            return;
        }

        rayBox    = box.GetComponent <RayBox>();
        container = box.GetComponent <BoxAtomContainer>();

        life = player.GetComponent <LifeSystem>();
    }
    public void showDrag(Vector3 startDrag, Vector3 endDrag)
    {
        RayBox box = new RayBox(startDrag, endDrag);

        box.drawBox();
    }