コード例 #1
0
        public void Remove(GUIWidget widget)
        {
            ISelectable selectable = widget as ISelectable;
            IEventListener <InputKeyEvent> keyListener = widget as IEventListener <InputKeyEvent>;

            if (selectable != null)
            {
                RemoveSelectable(selectable);
            }
            if (keyListener != null)
            {
                InputKeyListeners.Remove(keyListener);
            }
            Widgets.Remove(widget);
        }
コード例 #2
0
        public void Add(GUIWidget widget)
        {
            ISelectable selectable = widget as ISelectable;
            IEventListener <InputKeyEvent> keyListener = widget as IEventListener <InputKeyEvent>;

            if (selectable != null)
            {
                AddSelectable(selectable);
            }
            if (keyListener != null)
            {
                InputKeyListeners.Add(keyListener);
            }

            Widgets.Add(widget);
        }