private void CreateHandle() { Handle = AddUIComponent <UIDragHandle>(); Handle.size = new Vector2(500, 42); Handle.relativePosition = new Vector2(0, 0); Handle.target = parent; Handle.eventSizeChanged += ((component, size) => { Caption.size = size; Caption.CenterToParent(); }); Caption = Handle.AddUIComponent <UILabel>(); Caption.text = nameof(NodeMarkupPanel); Caption.textAlignment = UIHorizontalAlignment.Center; Caption.anchor = UIAnchorStyle.Top; Caption.eventTextChanged += ((component, text) => Caption.CenterToParent()); }