public static void DoSelectTemplateMenu(SkillTemplate SelectedTemplate, GenericMenu.MenuFunction ClearTemplate, GenericMenu.MenuFunction2 SelectTemplate) { Templates.LoadAll(); List <string> list = new List <string>(); GenericMenu genericMenu = new GenericMenu(); genericMenu.AddItem(new GUIContent(Strings.get_Menu_None()), false, ClearTemplate); using (List <SkillTemplate> .Enumerator enumerator = Templates.List.GetEnumerator()) { while (enumerator.MoveNext()) { SkillTemplate current = enumerator.get_Current(); string text = current.get_Category() + "/" + current.get_name(); string text2 = Labels.GenerateUniqueLabelWithNumber(list, text); list.Add(text); genericMenu.AddItem(new GUIContent(text2), SelectedTemplate == current, SelectTemplate, current); } } genericMenu.ShowAsContext(); }
public static string GenerateUniqueLabelWithNumber(List <string> labels, string label) { return(Labels.GenerateUniqueLabelWithNumber(labels, label)); }