// DvdS: Function after a unit is selected, insert here the good stuff public void DropdownChange(int index) { // DvdS: 0 is -select- if (index != 0) { selectedUnit.text = units[index]; UnitGroup ug = _active.GetComponent <UnitGroup>(); ug.type = (UnitType)System.Enum.Parse(typeof(UnitType), selectedUnit.text); _active.name = "Unit: " + ug.type.ToString(); ug.info = _uManager.GetUnitInfoByType(ug.type); _UFactory.AddUnit(ug); selectedUnit.color = ug.color; } else { selectedUnit.text = "You didn't select a unit"; selectedUnit.color = Color.red; } }