Public API Modifier functions
Concordance.Functions, assembly Concordance. For more information, refer to Modifier functions.Built-in functions
Each is [Serializable] and derives from ModifierFunction<T>. The functions that compare, such as Clamp<T>, need a < operator registered for T. A [SerializeReference] ModifierFunction<T> field registers the operators of its type, and so does creating a built-in function in code.
Set<T>
sealedSets the value, in place of the value before this modifier.
| T Value { get; set; } | The value to set. |
|---|
AtMost<T>
sealedCaps the value before this modifier: a value above the maximum becomes the maximum. Apply throws InvalidOperationException when no < operator is registered for T.
| T Max { get; set; } | The highest value let through. |
|---|
AtLeast<T>
sealedRaises the value before this modifier: a value below the minimum becomes the minimum. Apply throws InvalidOperationException when no < operator is registered for T.
| T Min { get; set; } | The lowest value let through. |
|---|
Clamp<T>
sealedKeeps the value before this modifier between a lowest and a highest value. When the lowest value is above the highest, the result is the lowest. Apply throws InvalidOperationException when no < operator is registered for T.
| T Min { get; set; } | The lowest value let through. |
|---|---|
| T Max { get; set; } | The highest value let through. |
Abs<T>
sealedTurns the value before this modifier into its absolute value: a value below the default, zero for numbers, is negated. Apply throws InvalidOperationException when no < or unary - operator is registered for T.
Snap
sealedRounds the value before this modifier to the nearest multiple of the step. Modifies a float.
| float Step { get; set; } | The multiple rounded to. Zero or less leaves the value unchanged. 1 by default. |
|---|
Remap
sealedReplaces the value before this modifier with the curve's value at that point. Modifies a float.
| AnimationCurve Curve { get; set; } | The mapping, from the value before this modifier to the value after it. Null leaves the value unchanged. A linear curve from (0, 0) to (1, 1) by default. |
|---|
Blend functions
sealedFloatBlend, Vector2Blend, Vector3Blend, Vector4Blend, ColorBlend and QuaternionBlend, labelled Blend in the dropdown. Each moves the value before this modifier toward a target, by a weight from 0 (unchanged) to 1 (the target), with the type's Lerp, or Quaternion.Slerp.
| T Target { get; set; } | The value moved toward. Quaternion.identity by default for QuaternionBlend. |
|---|---|
| float Weight { get; set; } | How far toward the target: 0 keeps the value, 1 reaches the target. Apply clamps it between 0 and 1. 0.5 by default. |
Scale functions
sealedVector2Scale, Vector3Scale and Vector4Scale, labelled Scale in the dropdown. Each multiplies the value before this modifier by a factor per axis.
| T Factor { get; set; } | The factor of each axis. One on every axis by default. |
|---|
BinaryOperation<T, TOperand>
sealedApplies a binary operator to the value before this modifier and the operand. A function field's dropdown lists one entry per operator and operand type the member's type has, such as Multiply (Single) on a Vector3. Apply throws InvalidOperationException when the operator is not registered for the two types.
| BinaryOperator Operator { get; set; } | The operator applied, chosen with the function in the dropdown. |
|---|---|
| TOperand Operand { get; set; } | The right operand. |
UnaryOperation<T>
sealedApplies a unary operator to the value before this modifier. Apply throws InvalidOperationException when the operator is not registered for T.
| UnaryOperator Operator { get; set; } | The operator applied, chosen with the function in the dropdown. |
|---|
Operators
BinaryOperator
enumA C# binary operator, which BinaryOperation<T, TOperand> applies to the value before a modifier and an operand. Every C# binary operator a type can overload, except the comparisons.
| Add | The + operator. |
|---|---|
| Subtract | The - operator. |
| Multiply | The * operator. |
| Divide | The / operator. |
| Remainder | The % operator. |
| And | The & operator. |
| Or | The | operator. |
| Xor | The ^ operator. |
| LeftShift | The << operator. |
| RightShift | The >> operator. |
UnaryOperator
enumA C# unary operator, which UnaryOperation<T> applies to the value before a modifier.
| Plus | The unary + operator. |
|---|---|
| Negate | The unary - operator. |
| Not | The ! operator. |
| Complement | The ~ operator. |
| Increment | The ++ operator. |
| Decrement | The -- operator. |
Operators<T, TOperand>
staticThe C# binary operators taking T and TOperand, for functions written once for every member type. Operators are registered for the type of each ModifierFunction<T> field and of each built-in function created in code, and only the operators the types have.
| T Apply(BinaryOperator @operator, T left, TOperand right) | Returns left combined with right by the operator, converted to T as a compound assignment converts it. Throws InvalidOperationException when the operator is not registered for the two types, and ArgumentOutOfRangeException when operator is not a defined value. |
|---|---|
| bool Has(BinaryOperator @operator) | Returns whether the operator is registered for the two types. |
Operators<T>
staticThe C# unary operators of T, for functions written once for every member type. Operators are registered for the type of each ModifierFunction<T> field and of each built-in function created in code, and only the operators the type has.
| T Apply(UnaryOperator @operator, T value) | Returns the operator applied to value, converted to T as a compound assignment converts it. Throws InvalidOperationException when the operator is not registered for T, and ArgumentOutOfRangeException when operator is not a defined value. |
|---|---|
| bool Has(UnaryOperator @operator) | Returns whether the operator is registered for T. |