Skip to main content

EditorFakeFocusEvents

A class in Root.Township, the global namespace.

Tracks whether the game window has input focus and raises static events when it changes. MenuSettings.isAlwaysOnFocus forces it to count as focused.

Constructors​

MemberWhat it is
EditorFakeFocusEvents()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

MemberWhat it is
static bool hasInputFocusWhether the window currently has input focus.

Events​

MemberWhat it is
static event Action InputFocusAcquiredRaised when the window gains focus.
static event Action InputFocusLostRaised when the window loses focus.

Methods​

2 private and internal methods
MemberWhat it is
private void Awake()Sets hasInputFocus from the application's focus state.
private void OnApplicationFocus(bool focus)Updates hasInputFocus and raises the matching event.