public void AddSingle(TinyEdge edge) { Clean(); In = edge.In; Out = edge.Out; OnEdgeSelectionChanged?.Invoke(edge.In, edge.Out); }
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); }
public bool IsSelected(TinyEdge edge) => edge != null && (_selections.Contains(edge.In) || _selections.Contains(edge.Out)) || In == edge.In && Out == edge.Out;
public void CopyEdge(Guid @out, Guid @in, object data) => _edges.Add(TinyEdge.Create(@out, @in, OnCopyEdge?.Invoke(data)));
protected override void OnDisable() => _edge = null;
protected override void InternalOnEnable() => _edge = serializedObject.targetObject as TinyEdge;
protected virtual void OnCreateEdge(TinyEdge edge) { }