public Rule(Action onRuleChanged = null) { OnRuleChanged = onRuleChanged; SourceBuildings = new PropertyEnumValue <SourceBuildingTypes>("Source", RuleChanged, SourceBuildingTypes.All); TargetBuildings = new PropertyEnumValue <TargetBuildingTypes>("Target", RuleChanged, TargetBuildingTypes.All); UseSize = new PropertyBoolValue("UseSize", RuleChanged, false); MaxLength = new PropertyStructValue <int>("MaxLength", RuleChanged, 4); MaxWidth = new PropertyStructValue <int>("MaxWidth", RuleChanged, 4); }
private LineAlignmentPropertyPanel AddAlignmentProperty(PropertyEnumValue <Alignment> property, string label) { var alignment = ComponentPool.Get <LineAlignmentPropertyPanel>(LineProperties, "LineAlignment"); alignment.Text = label; alignment.Init(); alignment.SelectedObject = property; alignment.OnSelectObjectChanged += (value) => property.Value = value; return(alignment); }
public MarkupStopLine(Markup markup, MarkupPointPair pointPair, StopLineStyle style = null, Alignment firstAlignment = Alignment.Centre, Alignment secondAlignment = Alignment.Centre) : base(markup, pointPair, false) { RawStartAlignment = new PropertyEnumValue <Alignment>("AL", AlignmentChanged, firstAlignment); RawEndAlignment = new PropertyEnumValue <Alignment>("AR", AlignmentChanged, secondAlignment); style ??= SingletonManager <StyleTemplateManager> .Instance.GetDefault <StopLineStyle>(Style.StyleType.StopLineSolid); var rule = new MarkupLineRawRule <StopLineStyle>(this, style, new EnterPointEdge(Start), new EnterPointEdge(End)); SetRule(rule); Update(true); RecalculateStyleData(); }
public MarkupRegularLine(Markup markup, MarkupPointPair pointPair, RegularLineStyle style = null, Alignment alignment = Alignment.Centre, bool update = true) : base(markup, pointPair, false) { RawAlignment = new PropertyEnumValue <Alignment>("A", AlignmentChanged, alignment); if (update) { Update(true); } if (style != null) { AddRule(style, false, false); RecalculateStyleData(); } }
public PropLineStyle(PropInfo prop, int probability, ColorOptionEnum colorOption, Color32 color, float step, Vector2 angle, float shift, Vector2 scale, float elevation, float offsetBefore, float offsetAfter) : base(prop, probability, step, angle, shift, scale, elevation, offsetBefore, offsetAfter) { Color.Value = color; ColorOption = new PropertyEnumValue <ColorOptionEnum>("CO", StyleChanged, colorOption); }
public DoubleSolidLineStyle(Color32 color, float width, float offset) : base(color, width) { Offset = GetOffsetProperty(offset); Alignment = GetAlignmentProperty(Manager.Alignment.Centre); }
public DoubleDashedLineStyle(Color32 color, float width, float dashLength, float spaceLength, float offset) : base(color, width, dashLength, spaceLength) { Offset = GetOffsetProperty(offset); Alignment = GetAlignmentProperty(Manager.Alignment.Centre); }