///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Focuses a widget /// </summary> /// /// <param name="widget">The widget that has to be focused</param> /// /// The previously focused widget will be unfocused. /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void FocusWidget(Widget widget) { // Don't do anything when the widget is already focused if (m_FocusedWidget != widget) { // Unfocus the currently focused widget if (m_FocusedWidget != null) { m_FocusedWidget.m_Focused = false; m_FocusedWidget.OnWidgetUnfocused(); } // Focus the new widget m_FocusedWidget = widget; widget.m_Focused = true; widget.OnWidgetFocused(); } }