protected static UIComponent AddInvertProperty(IAsymLine asymStyle, UIComponent parent) { var invertProperty = parent.AddUIComponent <BoolPropertyPanel>(); invertProperty.Text = Localize.LineEditor_Invert; invertProperty.Init(); invertProperty.Value = asymStyle.Invert; invertProperty.OnValueChanged += (bool value) => asymStyle.Invert = value; return(invertProperty); }
protected static ButtonsPanel AddInvertProperty(IAsymLine asymStyle, UIComponent parent) { var buttonsPanel = parent.AddUIComponent <ButtonsPanel>(); var invertIndex = buttonsPanel.AddButton(Localize.LineEditor_Invert); buttonsPanel.Init(); buttonsPanel.OnButtonClick += OnButtonClick; void OnButtonClick(int index) { if (index == invertIndex) { asymStyle.Invert = !asymStyle.Invert; } } return(buttonsPanel); }