Skip to content

Commit 1c09f48

Browse files
committed
fix: fix an index out of range error & update version number
1 parent f7ebd67 commit 1c09f48

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

Editor/Scripts/Node/PlayableNode.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,19 @@ public override void Update()
5151
continue;
5252
}
5353

54-
var childNodeIndex = FindChildPlayableNode(inputPlayable);
55-
if (childNodeIndex >= 0)
54+
// FIXME: A Playable may has multi output ports,
55+
// and if all these output ports connected to same input port,
56+
// 'i' will be greater than InternalInputs.Count, so there is a check.
57+
if (i < InternalInputs.Count)
5658
{
57-
var input = InternalInputs[i];
58-
input.Node.AddFlag(NodeFlag.Active);
59-
InternalInputs[i] = input.Copy(input, i);
60-
continue;
59+
var childNodeIndex = FindChildPlayableNode(inputPlayable);
60+
if (childNodeIndex >= 0)
61+
{
62+
var input = InternalInputs[i];
63+
input.Node.AddFlag(NodeFlag.Active);
64+
InternalInputs[i] = input.Copy(input, i);
65+
continue;
66+
}
6167
}
6268

6369
// create new node
@@ -161,10 +167,11 @@ protected override void AppendStateDescriptions(StringBuilder descBuilder)
161167
descBuilder.Append("#").Append(i.ToString()).Append(" InputWeight: ")
162168
.AppendLine(Playable.GetInputWeight(i).ToString("F3"));
163169
}
170+
164171
descBuilder.Append("OutputCount: ").AppendLine(Playable.GetOutputCount().ToString());
165172
}
166173
}
167174

168175
#endregion
169176
}
170-
}
177+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.greenbamboogames.playablegraphmonitor",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"displayName": "PlayableGraphMonitor!",
55
"description": "PlayableGraph monitor.",
66
"unity": "2019.4",

0 commit comments

Comments
 (0)