public static void DrawFoldout(Rect position, Expression expression, GUIContent label) { using (new InvalidScope(!expression.HasError)) { using (var changes = new EditorGUI.ChangeCheckScope()) { var statement = FoldoutStringDrawer.Draw(position, label, expression.Statement, ref expression.IsExpanded); if (changes.changed) { expression.SetStatement(statement); } } } }
public static float GetHeight(Expression expression, bool foldout) { return(foldout ? FoldoutStringDrawer.GetHeight(expression.IsExpanded) : RectHelper.LineHeight * 5); }