Hi from Italy!
(I specify my nationality as an excuse for any grammatical errors. If so, correct me without problems. I must improve my English.)
I love the ExecuteInEditMode attribute, and I’m trying to create a tool for a Lara Croft Go-like game.
Besides grid snapping, I also have to rotate my tiles by 90 degrees around their local y-axis.
Here the problem: there is no real match between the angle visualized on the rotation gizmo and the rotation itself. I think that the rotation tool adds\subtracts a delta each frame as long as the mouse button is down, and the method used for positions doesn’t work 'cause this tiny delta never exceeds the “RoundToInt” threshold of the snap.
It’s hard to explain, so I make an example.
I create a cube.
I attached a script on this cube that prints its transform.eulerAngles.y each frame.
In the scene, I select the rotate tool and, while pressing CTRL\command, I rotate the cube by any angle.
The script prints 15-15 degrees on the console (the unity default angle snap value), not the angle.
Hope that’s a legitimate question, as it’s not directly material of this lecture.
Or this is the right place to ask.
In case, I apologize. But if you can help, I would really appreciate it.
Thanks.