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

Window Focusing #25

Open
glacay30 opened this issue Nov 8, 2019 · 1 comment
Open

Window Focusing #25

glacay30 opened this issue Nov 8, 2019 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@glacay30
Copy link
Member

glacay30 commented Nov 8, 2019

Feature Information

The current GUI doesn't seem to have a system for focusing windows to prevent unwanted inputs from affecting other aspects of the simulations. This was discovered by opening up the settings menu and using WASD to move the sub, which intuitively shouldn't happen since you want the focus to be on the settings menu.

For the future, this is especially relevant if other systems are created (more than just control the sub with keyboard inputs and type stuff into the one field of the settings menu.)

Solution Information

Either Unity already has some kind of focus system that just needs to be researched or one needs to be created. Most likely a focus manager that somehow keeps track of what is allowed to be affected by inputs (keyboard and mouse).

The issue is that other aspects of the sim shouldn't have to be affected internally (ie having a "isFocused" method needing to be called everywhere as that's too much coupling) yet somehow the manager needs to allows inputs to flow through itself and filtered out to other game objects that require it.

@glacay30 glacay30 added the bug Something isn't working label Nov 8, 2019
@philippeollivier
Copy link

Semi-resolved in commit ec6ca17. Upon pressing settings button, it calls the HUDFocus script's method onFocus(). This sets Time.timeScale to 0 which essentially pauses the game for Rigidbodies.

@swspatel swspatel added this to the V2 milestone Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants