void UpdateMessages() { var messages = Lib.GetMessages(); for (int i = 0; i < messages.Length; ++i) { var message = messages[i]; var id = message.windowId; switch (message.type) { case MessageType.WindowAdded: { var window = AddWindow(id); if (window.isAlive && window.isDesktop) { desktops_.Add(id); onDesktopAdded.Invoke(window); } else { onWindowAdded.Invoke(window); } break; } case MessageType.WindowRemoved: { var window = Find(id); if (window != null) { window.isAlive = false; if (window.parentWindow != null) { window.parentWindow.onChildRemoved.Invoke(window); } windows.Remove(id); if (window.isAlive && window.isDesktop) { desktops_.Remove(id); onDesktopRemoved.Invoke(window); } else { onWindowRemoved.Invoke(window); } } break; } case MessageType.WindowCaptured: { var window = Find(id); if (window != null) { window.onCaptured.Invoke(); } break; } case MessageType.WindowSizeChanged: { var window = Find(id); if (window != null) { window.onSizeChanged.Invoke(); } break; } case MessageType.IconCaptured: { var window = Find(id); if (window != null) { window.onIconCaptured.Invoke(); } break; } case MessageType.CursorCaptured: { cursor.onCaptured.Invoke(); break; } default: { break; } } } }
void UpdateWindowInfo() { cursorWindowId_ = Lib.GetWindowIdUnderCursor(); }
void OnDisable() { Lib.SetLogFunc(null); Lib.SetErrorFunc(null); }
void OnEnable() { Lib.SetLogFunc(onDebugLog); Lib.SetErrorFunc(onDebugErr); }
void OnApplicationQuit() { Resources.UnloadUnusedAssets(); Lib.Finalize(); }
void Awake() { Lib.SetDebugMode(debugMode); Lib.Initialize(); renderEventFunc_ = Lib.GetRenderEventFunc(); }