Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the nav mesh visibility when a nav mesh is loaded #6320

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

keianhzo
Copy link
Contributor

Fixes #6315

This PR sets the nav-mesh visibility when a nav-mesh component is added to make sure that the mesh visibility is always aligned with the preference setting.

if (isEnabled) {
addDebugMaterial(world, navEid);
} else {
removeDebugMaterial(world, navEid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does removeDebugMaterial really need to be called here? Does it mean there is a chance that debug material is already added?

@takahirox
Copy link
Contributor

takahirox commented Oct 12, 2023

Honestly setting the default visibility for nav mesh in audio debug system is very unintuitive to me. Ideally it is defaulted (as invisible) somewhere else like where nav mesh is created?

It might be ok to merge this PR (after reflecting the review comments) for now and revisit this design later tho.

@keianhzo
Copy link
Contributor Author

Not sure about that. The audio-debug service is the only point were we manage the nav-mesh visibility so it doesn't feel wrong to me if we keep that responsibility there instead of spreading it. I'm going to merge this and we can think about it in the future.

@keianhzo keianhzo merged commit 97b9686 into master Oct 13, 2023
10 of 12 checks passed
@keianhzo keianhzo deleted the bitecs-nav-mesh-visibility-fix branch October 13, 2023 10:20
@takahirox
Copy link
Contributor

It is ok that debug audio system controls nav meshes visibility. But I think the default nav mesh visibility should be set up when it's initialized. The default nav mesh visibility shouldn't really rely to audio debug system. Imagine a case that audio debug system is removed due to a certain reason. It shouldn't affect the default nav mesh visibility. In general less dependencies better design.

Also imagine that a new reader want to know where the default nav mesh is set. It is hard for the one to find from audio debug system because it requires to know background. More intuitive design more maintainable.

@keianhzo keianhzo mentioned this pull request Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-loader P1 Address as quickly as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bitECS - Old scenes may have nav meshes visible by default, we should ensure reverse compatibility
2 participants