public static IExpressionNode CreateNode(ExpressionTypes type)
        {
            IExpressionNode node = null;

            switch (type)
            {
                case ExpressionTypes.BlockExpression:
                    node = new PExpression();
                    break;
                case ExpressionTypes.StatementExpression:
                    node = new StatementExpressionNode();
                    break;
                case ExpressionTypes.UnaryExpression:
                    break;
                case ExpressionTypes.BinaryExpression:
                    node = new BinaryExpressionNode();
                    break;
                case ExpressionTypes.TernaryExpression:
                    break;
                case ExpressionTypes.IdentifierExpression:
                    break;
                case ExpressionTypes.ValueExpression:
                    node = new ValueExpressionNode();
                    break;
            }

            return node;
        }
Пример #2
0
        public static IExpressionNode CreateNode(ExpressionTypes type)
        {
            IExpressionNode node = null;

            switch (type)
            {
            case ExpressionTypes.BlockExpression:
                node = new PExpression();
                break;

            case ExpressionTypes.StatementExpression:
                node = new StatementExpressionNode();
                break;

            case ExpressionTypes.UnaryExpression:
                break;

            case ExpressionTypes.BinaryExpression:
                node = new BinaryExpressionNode();
                break;

            case ExpressionTypes.TernaryExpression:
                break;

            case ExpressionTypes.IdentifierExpression:
                break;

            case ExpressionTypes.ValueExpression:
                node = new ValueExpressionNode();
                break;
            }

            return(node);
        }
Пример #3
0
        public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
        {
            base.GetPropertyHeight(property, label);

            pExpression = property.GetValue<PExpression>();
            textProperty = property.FindPropertyRelative("Text");
            int lineCount = textProperty.stringValue.Count(c => c == '\n' || c == '\r') + 1;
            height = Mathf.Max(lineCount * (lineHeight - 3f) + 4f, lineHeight);

            return height;
        }