VContainer icon indicating copy to clipboard operation
VContainer copied to clipboard

Proposal: IFocusable for OnApplicationFocus().

Open maxgmer opened this issue 1 year ago • 2 comments

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.

maxgmer avatar Jun 05 '24 13:06 maxgmer

agree!

lsw1164 avatar Jun 08 '24 07:06 lsw1164

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

stenyin avatar Oct 28 '24 09:10 stenyin