Update Scene.bf

Add type to componentTracker if the component's type key does not exist.
This commit is contained in:
Joseph Montanez 2021-05-24 10:34:16 -07:00
parent 5962faf056
commit f514bd5928

View File

@ -104,7 +104,19 @@ namespace Strawberry
private void TrackComponent(Component c)
{
for (let t in Tracker.AssignmentLists[c.GetType()]) {
// If component type not in tracker, add to tracker
var match = false;
for (let kvPair in componentTracker) {
if (kvPair.key == t) {
match = true;
}
}
if (!match) {
componentTracker.Add(t, new List<Component>());
}
componentTracker[t].Add(c);
}
}
private void UntrackComponent(Component c)