Ejemplo n.º 1
0
    public void AddSelection(string name)
    {
        if (tut && !tut.IsMessagePresent || !tut)
        {
            if (!string.IsNullOrEmpty(name))
            {
                SelectedUnits.Add(name);
                TutorialSelect();
                PlaySelectSound();
            }

            GameObject[] units = GameObject.FindGameObjectsWithTag("Units");
            foreach (var s in SelectedUnits)
            {
                foreach (var o in units)
                {
                    UnitScript u = o.GetComponent <UnitScript>();
                    if (u.Name == s)
                    {
                        u.SetSelectionEnabled(true);
                    }
                }
            }
        }
    }
Ejemplo n.º 2
0
    public void DeselectAllUnits()
    {
        GameObject[] units = GameObject.FindGameObjectsWithTag("Units");

        foreach (var o in units)
        {
            UnitScript u = o.GetComponent <UnitScript>();
            u.SetSelectionEnabled(false);
        }

        TutorialDeSelect();
        SelectedUnits.Clear();

        PlayDeselectSound();
    }