SnapValue
Rounds value to the closest multiple of snap if snapping is active. Note that snap can only be positive.
Read time 1 minuteLast updated 9 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor
SnapValue(float, float)
Rounds to the closest multiple of if snapping is active. Note that snap can only be positive.
valuesnappublic static float SnapValue(float value, float snap)
Parameters
Returns
Type | Description |
|---|---|
| float | If snapping is active, rounds |
SnapValue(Vector2, Vector2)
Rounds to the closest multiple of if snapping is active. Note that snap can only be positive.
valuesnappublic static Vector2 SnapValue(Vector2 value, Vector2 snap)
Parameters
Returns
Type | Description |
|---|---|
| Vector2 | If snapping is active, rounds |
SnapValue(Vector3, Vector3)
Rounds to the closest multiple of if snapping is active. Note that snap can only be positive.
valuesnappublic static Vector3 SnapValue(Vector3 value, Vector3 snap)
Parameters
Returns
Type | Description |
|---|---|
| Vector3 | If snapping is active, rounds |