public FixedGroupLengthConstraint(
     IFixedRectConstraintValueData valueData
     ) : base(
         valueData
         )
 {
 }
Exemple #2
0
 public FixedElementLengthConstraint(
     IFixedRectConstraintValueData valueData
     ) : base(
         valueData
         )
 {
 }
Exemple #3
0
 public FixedPaddingConstraint(
     IFixedRectConstraintValueData valueData
     ) : base(
         valueData
         )
 {
 }
Exemple #4
0
        IRectConstraint CreateRectConstraint(
            RectConstraintType constraintType,
            FixedRectValueType fixedValueType,
            RectTransform referenceRect,
            Vector2 constraintValue
            )
        {
            IRectConstraint rectConstraint;

            if (ConstraintIsFixedType(constraintType))
            {
                IFixedRectConstraintValueData fixedConstraintValueData = CreateFixedConstraintValueData(
                    fixedValueType,
                    referenceRect,
                    constraintValue
                    );

                switch (constraintType)
                {
                case RectConstraintType.FixedGroupLength:
                    rectConstraint = new FixedGroupLengthConstraint(
                        fixedConstraintValueData
                        );
                    break;

                case RectConstraintType.FixedElementLength:
                    rectConstraint = new FixedElementLengthConstraint(
                        fixedConstraintValueData
                        );
                    break;

                case RectConstraintType.FixedPadding:
                    rectConstraint = new FixedPaddingConstraint(
                        fixedConstraintValueData
                        );
                    break;

                default:
                    throw new System.InvalidOperationException(
                              "fixed constraint must be one of the three"
                              );
                }
            }
            else                      // first constraint is ratio
            {
                switch (constraintType)
                {
                case RectConstraintType.GroupToElementRatio:
                    rectConstraint = new GroupToElementRatioRectConstraint(
                        constraintValue
                        );
                    break;

                case RectConstraintType.ElementToPaddingRatio:
                    rectConstraint = new ElementToPaddingRatioRectConstraint(
                        constraintValue
                        );
                    break;

                case RectConstraintType.GroupToPaddingRatio:
                    rectConstraint = new GroupToPaddingRatioRectConstraint(
                        constraintValue
                        );
                    break;

                default:
                    throw new System.InvalidOperationException(
                              "ratio constraint must be one of three"
                              );
                }
            }
            return(rectConstraint);
        }
Exemple #5
0
 public AbsFixedRectConstraint(
     IFixedRectConstraintValueData valueData
     )
 {
     thisValueData = valueData;
 }