hadashiA / VContainer

The extra fast, minimum code size, GC-free DI (Dependency Injection) library running on Unity Game Engine.
https://vcontainer.hadashikick.jp
MIT License
1.81k stars 157 forks source link

Proposal: IFocusable for OnApplicationFocus(). #678

Open maxgmer opened 1 month ago

maxgmer commented 1 month ago

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 commented 1 month ago

agree!