crest
crest copied to clipboard
Make ocean tiles non-pickable by default
Issue #1056
Makes ocean tiles non-pickable by default, adds debug option for it.
This will stomp the users preference for pickability. However pickability is almost never desired I guess. And there's a debug option to disable it if need be. LMK what you think.
I initially just intended to respect the pickability state of the ocean gameobject and propagate it to the tiles but it was a non-starter it seems - simply querying pickability of the ocean using SceneVisibilityManager.instance.IsPickingDisabled(ocean.gameObject)
seems to clear the pickability flag on the ocean when exiting playmode. It's as if the pickability state is left hanging after exiting play mode, and then querying it refreshes it to default (pickable).
A side effect that might not be obvious: When the sea tiles are pickable, it breaks snapping objects together in the editor. It took a long time for me to figure out why my floor tiles up high would not snap to each other, but this turned out to be the cause (as from a sufficient distance moving the target passed over dozens of sea tile snap points).
Please merge this 🤞
@NewColours you could lock the Water layer instead? That appears to hold up even on editor restarts. Let me know how you go.
Reference: https://blog.theknightsofunity.com/hide-lock-layer-scene-window/
Closing in favour of #1066