protected override void OnComponentRemoved(Component component) { if (component == this.mover) this.mover = null; if (component == this.shape) this.shape = null; base.OnComponentRemoved(component); }
protected override void OnComponentAdded(Component component) { base.OnComponentAdded(component); if (component is Mover) { if (this.mover != null) this.RemoveComponent(this.mover); this.mover = component as Mover; } if (component is Shape) { if (this.shape != null) this.RemoveComponent(this.shape); this.shape = component as Shape; } }