This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public float snapValue = 0.5; | |
public float depth = 0; | |
void Update() { | |
float snapInverse = 1/snapValue; | |
float x, y, z; | |
// if snapValue = .5, x = 1.45 -> snapInverse = 2 -> x*2 => 2.90 -> round 2.90 => 3 -> 3/2 => 1.5 |