private void AddNode(ref PathNode origin) { if (!nodes.Contains(origin)) { origin = nodes.AddAndGet(origin); foreach (var area in areas) { if (area.isInside(origin)) { area.AddNode(origin); } } } }