Unity Dialogue System - Removing port connections (Edges)

Unity Dialogue System - Removing port connections (Edges)

In this video we're going to be deleting the node port connections, or Edges, in three different situations:

Through the "Delete" contextual menu action or key, through removing the node and through custom contextual menu actions we'll be adding to the node.

________________________________________________________

Timestamps:

00:00 Introduction
01:06 Removing edges through the "Delete" action
02:42 Next Problem: Deleting nodes doesn't remove the edges
03:14 Creating the "DisconnectPorts" method
03:50 Updating the "DisconnectPorts" method
05:23 Creating the "DisconnectAllPorts" method
05:42 Updating the "DisconnectAllPorts" method
05:54 Calling the "DisconnectAllPorts" method
06:28 Next Feature: Adding a custom contextual menu action to the nodes
06:54 Overriding the "BuildContextualMenu" method
07:27 Updating the "BuildContextualMenu" method
08:43 Creating two extra "DisconnectPort" methods

________________________________________________________

Useful links:

● GraphView (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.GraphView.html
● Edge (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.Edge.html
● Port (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.Port.html
● "connected" Variable (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.Port-connected.html
● "connections" Variable (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.Port-connections.html
● Node (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.Node.html
● "inputContainer" Variable (Unity Documentation): https://docs.unity3d.com/2018.3/Documentation/ScriptReference/Experimental.UIElements.GraphView.Node-inputContainer.html
● "outputContainer" Variable (Unity Documentation): https://docs.unity3d.com/2018.3/Documentation/ScriptReference/Experimental.UIElements.GraphView.Node-outputContainer.html
● "BuildContextualMenu" Method (Unity Documentation): https://docs.unity3d.com/2020.1/Documentation/ScriptReference/Experimental.GraphView.Node.BuildContextualMenu.html
● "deleteSelection" Callback (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.GraphView-deleteSelection.html
● "DeleteElements" Method (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.GraphView.DeleteElements.html
● "RemoveElement" Method (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.GraphView.RemoveElement.html
● "RemoveElements" Method (Unity Documentation): https://docs.unity3d.com/ScriptReference/Experimental.GraphView.Scope.RemoveElements.html
● List (C# Documentation): https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1?view=net-5.0
● Dialogue System (Playlist): https://www.youtube.com/watch?v=nvELzBYMK1U&list=PL0yxB6cCkoWK38XT4stSztcLueJ_kTx5f
● Requirements (Playlist Video): https://www.youtube.com/watch?v=nvELzBYMK1U&list=PL0yxB6cCkoWK38XT4stSztcLueJ_kTx5f

________________________________________________________

● Subscribe: https://www.youtube.com/channel/UCeeZW9pXSyDqLLu7t5xX7ug?sub_confirmation=1

● Follow me on Twitter: https://twitter.com/IndieWafflus

________________________________________________________

Unity Dialogue SystemUnity Dialog SystemUnity Graph View

Post a Comment

0 Comments