[MaxVector2]

Attribute used for clamping a Vector2 field components to maximum values.

Support Types

Type
Example
Description

Vector2

Vector2

2D vector representation

Parameters

Parameter Name
Description

x

Maximum allowed value for X component.

y

Maximum allowed value for Y component.

xProperty

Name of property providing maximum value for X.

yProperty

Name of property providing maximum value for Y.

Examples

[MaxVector2(10, 10)]
public Vector2 position;

public float maxY = 5;

[MaxVector2(10, "maxY")]
public Vector2 velocity;

[MaxVector2("maxX", "maxY")]
public Vector2 limits;

Last updated