Skip to content

Feat: Respect Unity gizmos settings when drawing room template settings inspector#132

Open
Necronomison wants to merge 2 commits into
OndrejNepozitek:masterfrom
Bramvale-Studios:feat/respect-gizmos-settings
Open

Feat: Respect Unity gizmos settings when drawing room template settings inspector#132
Necronomison wants to merge 2 commits into
OndrejNepozitek:masterfrom
Bramvale-Studios:feat/respect-gizmos-settings

Conversation

@Necronomison
Copy link
Copy Markdown

@Necronomison Necronomison commented Mar 18, 2025

Context:

Right now, despite toggling either the entire gizmos off, or toggling gizmos off specifically for RoomTemplateSettingsGrid2D, the room outlines continue to draw in the editor scene view.

Problem:

The reason this happens is because currently the outline are drawn from a callback hooked into Unity's SceneView.duringSceneGui callback, which does not respect gizmos settings.

Solution:

To manage this, I've implemented the following checks in the onSceneGUIPersistent callback method:

  • First check if all gizmos are turned off. If so, dont draw (return)
  • Otherwise, check if gizmos are specifically turned off for this script (RoomTemplateSettingsGrid2D). If so, don't draw (return).

Testing:

test-gizmos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant