//select a particular ability public static void Select(int newID) { if (newID == instance.selectedID) { return; } if (newID < 0 || newID >= instance.abilityList.Count) { return; } instance.selectedID = newID; TDS.SwitchAbility(GetSelectedAbility()); //launch the ability switch event to inform the UI }