Пример #1
0
 public void AddSingle(TinyEdge edge)
 {
     Clean();
     In  = edge.In;
     Out = edge.Out;
     OnEdgeSelectionChanged?.Invoke(edge.In, edge.Out);
 }
Пример #2
0
        public void CreateEdge(Guid @out, Guid @in, object data = default)
        {
            if (@in == @out || _edges.Any(x => x.In == @in && x.Out == @out))
            {
                return;
            }

            var edge = TinyEdge.Create(@out, @in, data);

            OnCreateEdge?.Invoke(edge);
            _edges.Add(edge);
        }
Пример #3
0
 public bool IsSelected(TinyEdge edge) =>
 edge != null && (_selections.Contains(edge.In) || _selections.Contains(edge.Out)) ||
 In == edge.In && Out == edge.Out;
Пример #4
0
 public void CopyEdge(Guid @out, Guid @in, object data) =>
 _edges.Add(TinyEdge.Create(@out, @in, OnCopyEdge?.Invoke(data)));
Пример #5
0
 protected override void OnDisable() =>
 _edge = null;
Пример #6
0
 protected override void InternalOnEnable() =>
 _edge = serializedObject.targetObject as TinyEdge;
Пример #7
0
 protected virtual void OnCreateEdge(TinyEdge edge)
 {
 }