Exemplo n.º 1
0
    //---- Getters ----

    //Check if character is near an object of that group
    public bool IsNearGroup(GroupData group)
    {
        foreach (Selectable select in Selectable.GetAllActive())
        {
            if (select.HasGroup(group))
            {
                float dist = (select.transform.position - transform.position).magnitude;
                if (dist < select.use_range)
                {
                    return(true);
                }
            }
        }
        return(false);
    }