Skip to content

Commit

Permalink
Fix start node issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BDeshiDev committed Apr 3, 2024
1 parent 133f94c commit 7e0054b
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ public override Node AddNode(Type type)
public bool TryGetDefaultTable(out TableReference defaultTableReference)
{
defaultTableReference = default;
var startNode = FindStartNode();
if (startNode == null)
{
return false;
}

foreach (var node in nodes)
{
if (node is DialogueLineNodeBase dialogueLineNodeBase)
Expand Down Expand Up @@ -133,22 +127,23 @@ public void HandleDialogueEnded()
OnDialogueEnded?.Invoke(this);
}

private void FindStartNode()
private DialogueStartNode FindStartNode()
{
if (_startNode != null)
{
return;
return null;
}
foreach (var node in nodes)
{
Debug.Log("node " , node);
if (node is DialogueStartNode startNode)
{
_startNode = startNode;
return;
return startNode;
}
}

return null;
Debug.LogError($"NO START NODE FOR DIALOGUE GRAPH {this}");
}

Expand Down

0 comments on commit 7e0054b

Please sign in to comment.