I’m developing a custom editor to assist with creating levels for my tile-based (but still 3D) tactics game. One of the features is a Diablo-style grid snapping system for props and other grid-occupying objects that allows designers to drag the prefab out over the grid, see any collisions it might have with existing geometry-filled tiles, and drop it in an empty space. If they attempt to drop an object in a space that isn’t empty, it should snap back to its position before they started moving it.
I have most this system already developed and working for me, but thus far I haven’t been able to find a good means of detecting these two states in my custom editor code, to tie it all together:
- When a user has first started to move an object with the Move transform tool (ideally before it moves).
- When a user has released the mouse button and stopped moving an object with the Move transform tool.