Exemple #1
0
    public UnitGroup SnapSelection()
    {
        gameObject.collider.enabled = true;
        group.ResetGroup();

        // Check Selected
        foreach (GameObject unit in GameObject.FindGameObjectsWithTag("Clickable"))
        {
            if (gameObject.collider.bounds.Contains(unit.transform.position) && unit.GetComponent <UnitScript>())
            {
                group.BeginGroupFill(unit);
            }
        }

        group.EndGroupFill();
        gameObject.collider.enabled = false;
        return(group);
    }