コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: Line.cs プロジェクト: MacSergey/NodeMarkup
        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();
        }
コード例 #4
0
ファイル: Line.cs プロジェクト: caillou15/NodeMarkup
        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();
            }
        }
コード例 #5
0
 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);
 }
コード例 #6
0
 public DoubleSolidLineStyle(Color32 color, float width, float offset) : base(color, width)
 {
     Offset    = GetOffsetProperty(offset);
     Alignment = GetAlignmentProperty(Manager.Alignment.Centre);
 }
コード例 #7
0
 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);
 }