Пример #1
0
        //--------------------------------------------------------------------------------------------------

        public override void Start()
        {
            _Panel = PropertyPanel.CreatePanel <BodyPropertyPanel>(Entity);
            InteractiveContext.Current.PropertyPanelManager?.AddPanel(_Panel, PropertyPanelSortingKey.Body);

            _ShapePanel = PropertyPanel.CreatePanel <BodyShapePropertyPanel>(Entity);
            InteractiveContext.Current.PropertyPanelManager?.AddPanel(_ShapePanel, PropertyPanelSortingKey.BodyShape);

            _UpdateComponents();

            Entity.PropertyChanged          += _Body_PropertyChanged;
            InteractiveEntity.VisualChanged += _InteractiveEntity_VisualChanged;

            _UpdateGhost();
        }
Пример #2
0
        //--------------------------------------------------------------------------------------------------

        public override void Stop()
        {
            InteractiveEntity.VisualChanged -= _InteractiveEntity_VisualChanged;
            Entity.PropertyChanged          -= _Body_PropertyChanged;

            _GhostVisualObject?.Remove();
            _GhostVisualObject = null;

            foreach (var componentEditor in _ComponentEditors.Values)
            {
                componentEditor.Stop();
            }
            _ComponentEditors.Clear();

            InteractiveContext.Current.PropertyPanelManager?.RemovePanel(_ShapePanel);
            _ShapePanel = null;
            InteractiveContext.Current.PropertyPanelManager?.RemovePanel(_Panel);
            _Panel = null;
        }