SnapValue
Rounds value to the closest multiple of snap if snapping is active (refer to EditorSnapSettings.incrementalSnapActive ). Note that snap can only be positive.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
SnapValue(float, float)
Rounds to the closest multiple of if snapping is active (refer to EditorSnapSettings.incrementalSnapActive). Note that snap can only be positive.
valuesnappublic static float SnapValue(float value, float snap)
Parameters
Returns
Type | Description |
|---|---|
| float | If (refer to EditorSnapSettings.incrementalSnapActive) 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 |