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

Proposal: IFocusable for OnApplicationFocus(). #678

Open
maxgmer opened this issue Jun 5, 2024 · 2 comments
Open

Proposal: IFocusable for OnApplicationFocus(). #678

maxgmer opened this issue Jun 5, 2024 · 2 comments

Comments

@maxgmer
Copy link

maxgmer commented Jun 5, 2024

I use the approach you recommended with MonoBehaviors used for views, while plain C# scripts being controllers for views.

I have a problem with a task, where I should update view (in this case view is an external script I cannot change) when application focus changes.

Can you add an interface like "IFocusable", similar to other interfaces outlined here? https://vcontainer.hadashikick.jp/integrations/entrypoint
(void OnApplicationFocus() of MonoBehavior).

This would greatly simplify this use-case without having to add additional "event hook" MonoBehaviors.

@lsw1164
Copy link

lsw1164 commented Jun 8, 2024

agree!

@stenyin
Copy link
Contributor

stenyin commented Oct 28, 2024

Adding an IFocusable might be unnecessary. You can use Application.focusChanged directly in Initialize to handle focus changes without extra interfaces.

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

No branches or pull requests

3 participants