// assign values to the field [change string values] public static void PopulateField(List <FloatField> list) { string name = "Floats"; string[] items = SimpleGUICommon.PopulateDropDownField <FloatField, float>(list, "F:"); if (items.Length > 0) { field.setValues(name, items); } else { field.clearValues(); } }
// assign values to the field [change string values] public static void PopulateField(List <BoolField> list) { string name = "Bools"; string[] items = SimpleGUICommon.PopulateDropDownField <BoolField, bool>(list, "B:"); if (items.Length > 0) { field.setValues(name, items); } else { field.clearValues(); } }
// assign values to the field [change string values] public static void PopulateField(List <HeroObjectField> list) { string name = "Hero Objects"; string[] items = SimpleGUICommon.PopulateDropDownField <HeroObjectField, HeroObject>(list, "HO:"); if (items.Length > 0) { field.setValues(name, items); } else { field.clearValues(); } }
// assign values to the field [change string values] public static void PopulateField(FieldInfo[] list) { List <string> itemNames = new List <string>(from element in list select element.Name); string name = "Fields"; string[] items = SimpleGUICommon.PopulateDropDownField(itemNames); if (items.Length > 0) { field.setValues(name, items); } else { field.clearValues(); } }
// assign values to the field [change string values] public static void PopulateField(List <UnityObjectField> list) { string name = "Unity Objects"; string[] items = SimpleGUICommon.PopulateDropDownField <UnityObjectField, UnityEngine.Object>(list, "UO:"); // append the type of item stored for (int i = 0; i < items.Length; i++) { // create item names string itemType = ""; switch (list[i].objectType) { case 1: itemType = "Audio Clip"; break; case 2: itemType = "Sprite"; break; case 3: itemType = "Scene"; break; case 4: itemType = "Particle System"; break; case 5: itemType = "Mono Script"; break; } items[i] += " (" + itemType + ")"; } if (items.Length > 0) { field.setValues(name, items); } else { field.clearValues(); } }
// assign values to the field [change string values] private void PopulateField() { List <string> layerName = new List <string>(); for (int i = 0; i < 32; i++) { // get layer names layerName.Add("Layer " + i + ": " + LayerMask.LayerToName(i)); } string name = "Layers"; string[] items = SimpleGUICommon.PopulateDropDownField(layerName); if (items.Length > 0) { field.setValues(name, items); } else { field.clearValues(); } }
// assign values to the field [change string values] public static void PopulateField(HeroProperties[] list) { string name = "Properties"; List <string> itemNames = new List <string>(); for (int i = 0; i < list.Length; i++) { string abbreviation = "[" + "P" + i + "] "; string heroPropertyName = (list[i].propertyTemplate != null) ? abbreviation + list[i].propertyTemplate.name : abbreviation + "[none]"; itemNames.Add(heroPropertyName); } string[] items = SimpleGUICommon.PopulateDropDownField(itemNames); if (items.Length > 0) { field.setValues(name, items); } else { field.clearValues(); } }
// assign values to the field [change string values] public static void PopulateField() { List <string> tagName = new List <string>(); for (int i = 0; i < UnityEditorInternal.InternalEditorUtility.tags.Length; i++) { // get tag names tagName.Add("Tag " + i + ": " + UnityEditorInternal.InternalEditorUtility.tags[i]); } string name = ""; string[] items = SimpleGUICommon.PopulateDropDownField(tagName); if (items.Length > 0) { field.setValues(name, items); } else { field.clearValues(); } }