static void DrawEdge(Graphs.Edge edge, Color color) { var p1 = GetPositionAsFromSlot(edge.fromSlot); var p2 = GetPositionAsToSlot(edge.toSlot); DrawEdge(p1, p2, color * edge.color); }
static void DrawEdge(Graphs.Edge edge, Color color) { var p1 = GetPositionAsFromSlot(edge.fromSlot); var p2 = GetPositionAsToSlot(edge.toSlot); DrawEdge(p1, p2, color * edge.color, EdgeTriggersTracker.GetTimings(edge)); }
public EdgeInfo GetEdgeInfo(UnityEditor.Graphs.Edge edge) { if (edge.toSlot == null) { return(null); } return(this.m_ConnectedSlotsCache[GenerateConnectionKey(edge.fromSlot.node, edge.toSlot.node)]); }
// Remove a connection between slots. public override void RemoveEdge(Graphs.Edge edge) { if (_isEditing) { var fromSlot = edge.fromSlot; var toSlot = edge.toSlot; // Make this operation undoable. var fromNodeRuntime = ((Node)fromSlot.node).runtimeInstance; Undo.RecordObject(fromNodeRuntime, "Disconnect"); // Remove the serialized event. ConnectionTools.DisconnectSlots(fromSlot, toSlot); } base.RemoveEdge(edge); }
public override void Connect(UnityEditor.Graphs.AnimationStateMachine.Node toNode, UnityEditor.Graphs.Edge edge) { if (toNode is StateNode) { base.graphGUI.stateMachineGraph.activeStateMachine.AddStateMachineTransition(this.stateMachine, (toNode as StateNode).state); base.graphGUI.stateMachineGraph.RebuildGraph(); } else if (toNode is StateMachineNode) { UnityEditor.Graphs.AnimationStateMachine.Node.GenericMenuForStateMachineNode(toNode as StateMachineNode, true, delegate(object data) { if (data is AnimatorState) { base.graphGUI.stateMachineGraph.activeStateMachine.AddStateMachineTransition(this.stateMachine, data as AnimatorState); } else { base.graphGUI.stateMachineGraph.activeStateMachine.AddStateMachineTransition(this.stateMachine, data as AnimatorStateMachine); } base.graphGUI.stateMachineGraph.RebuildGraph(); }); } else if (toNode is ExitNode) { base.graphGUI.stateMachineGraph.activeStateMachine.AddStateMachineExitTransition(this.stateMachine); base.graphGUI.stateMachineGraph.RebuildGraph(); } }
public override void Connect(UnityEditor.Graphs.AnimationStateMachine.Node toNode, UnityEditor.Graphs.Edge edge) { if (toNode is StateNode) { if (this.draggingDefaultState) { this.m_StateMachine.defaultState = (toNode as StateNode).state; } else { this.m_StateMachine.AddEntryTransition((toNode as StateNode).state); } base.graphGUI.stateMachineGraph.RebuildGraph(); } else if (toNode is StateMachineNode) {
public override void Connect(UnityEditor.Graphs.AnimationStateMachine.Node toNode, UnityEditor.Graphs.Edge edge) { if (toNode is StateNode) { base.graphGUI.stateMachineGraph.rootStateMachine.AddAnyStateTransition((toNode as StateNode).state); base.graphGUI.stateMachineGraph.RebuildGraph(); } if (toNode is StateMachineNode) { StateMachineNode node = toNode as StateMachineNode; if (node.stateMachine != base.graphGUI.parentStateMachine) { UnityEditor.Graphs.AnimationStateMachine.Node.GenericMenuForStateMachineNode(toNode as StateMachineNode, true, delegate(object data) { if (data is AnimatorState) { base.graphGUI.stateMachineGraph.rootStateMachine.AddAnyStateTransition(data as AnimatorState); } else if (data is AnimatorStateMachine) { base.graphGUI.stateMachineGraph.rootStateMachine.AddAnyStateTransition(data as AnimatorStateMachine); } base.graphGUI.stateMachineGraph.RebuildGraph(); }); } } if (toNode is EntryNode) { base.graphGUI.stateMachineGraph.rootStateMachine.AddAnyStateTransition(base.graphGUI.activeStateMachine); } }
public virtual void Connect(UnityEditor.Graphs.AnimationStateMachine.Node toNode, UnityEditor.Graphs.Edge edge) { }