예제 #1
0
        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);
                    }
                }
            }
        }
예제 #2
0
 public static float GetHeight(Expression expression, bool foldout)
 {
     return(foldout ? FoldoutStringDrawer.GetHeight(expression.IsExpanded) : RectHelper.LineHeight * 5);
 }