private void InitItemList() { itemList = null; if (groups_prop.arraySize == 0) { return; } itemList = new ProcessingItemListDrawer(); var prop = groups_prop.GetArrayElementAtIndex(selected); var list_prop = prop.FindPropertyRelative("processingItems"); var name_prop = prop.FindPropertyRelative("name"); itemList.InitReorderList(list_prop); itemList.drawHeaderCallback = (Rect rect) => { var labelRect = new Rect(rect.x + 2, rect.y + 2, rect.width * 0.15f, EditorGUIUtility.singleLineHeight); var nameRect = new Rect(rect.x + 2 + rect.width * 0.15f, rect.y + 4, rect.width * 0.15f, EditorGUIUtility.singleLineHeight); EditorGUI.LabelField(labelRect, "name:"); name_prop.stringValue = EditorGUI.TextField(nameRect, name_prop.stringValue, EditorStyles.miniTextField); var btnRect = new Rect(rect.x + rect.width * 0.35f, rect.y, 20, EditorGUIUtility.singleLineHeight); if (GUI.Button(btnRect, new GUIContent("p", "批量处理"), EditorStyles.miniButton)) { OnProcessGroup(name_prop.stringValue); } }; }
private ProcessingItemListDrawer GetProcessItemListDrawer(SerializedProperty prop, int index) { if (!processItemListDic.ContainsKey(index) || processItemListDic[index] == null) { processItemListDic[index] = new ProcessingItemListDrawer(); processItemListDic[index].InitReorderList(prop); } var processItemList = processItemListDic[index]; return(processItemList); }