private float GetTaskItemHeight(int managerId, int taskId) { var dependencies = TaskDiagnose.GetDependencyDebugInfos(managerId, taskId); var height = EditorGUI.GetPropertyHeight(SerializedPropertyType.String, GUIContent.none); return(Mathf.Max(height, dependencies.Count * DependencyItemHeight)); }
private void DrawTask(int managerId, int taskId) { var height = GetTaskItemHeight(managerId, taskId); var rect = GUILayoutUtility.GetRect(this.position.width, height); var x = rect.x; var y = rect.y; var splitedSize = headerSplitState.realSizes; var h = EditorGUI.GetPropertyHeight(SerializedPropertyType.String, new GUIContent(taskId.ToString())); EditorGUI.LabelField(new Rect(x, y, splitedSize[0], h), taskId.ToString()); x += splitedSize[0]; //draw status h = EditorGUI.GetPropertyHeight(SerializedPropertyType.String, GUIContent.none); DrawTaskStatus(managerId, taskId, new Rect(x, y, splitedSize[1], h)); x += splitedSize[1]; //draw dependencies var dependencies = TaskDiagnose.GetDependencyDebugInfos(managerId, taskId); foreach (var d in dependencies) { GUIContent icon = GUIContent.none; if (d.isActive) { icon = GUIHelper.iconSuccess; } else { icon = GUIHelper.iconIdle; } GUI.Label(new Rect(x, y, 20, 20), icon); EditorGUI.LabelField(new Rect(x + 20, y, splitedSize[2] - 20, DependencyItemHeight), d.name); y += DependencyItemHeight; } }