Skip to content

Commit 2f6d765

Browse files
committedSep 2, 2022
- fix another bug in map editor
1 parent e1bf142 commit 2f6d765

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
 

‎Assets/Scenes/GraphCreator.unity

+2-2
Original file line numberDiff line numberDiff line change
@@ -1421,9 +1421,9 @@ MonoBehaviour:
14211421
touchDragSpeed: -0.03
14221422
zoomEnabled: 1
14231423
linkedZoomDrag: 1
1424-
maxZoom: 100
1424+
maxZoom: 300
14251425
minZoom: 10
1426-
zoomStepSize: 0.5
1426+
zoomStepSize: 3
14271427
zoomToMouse: 0
14281428
followTarget: {fileID: 0}
14291429
lerpSpeed: 0.5

‎Assets/Scripts/GraphCreator/Graph.cs

+5
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,16 @@ public void LoadMapJson()
227227
string json = File.ReadAllText(jsonFileAddress);
228228
var parsed = JsonUtility.FromJson<GraphJsonData>(json);
229229

230+
var maxNode = 0;
230231
foreach (var node in parsed.nodes)
231232
{
232233
AddNode(node.id, node.position);
234+
if (node.id > maxNode)
235+
maxNode = node.id;
233236
}
234237

238+
_nextNodeIndex = maxNode + 1;
239+
235240
foreach (var edge in parsed.edges)
236241
{
237242
AddEdge(edge.node1Id, edge.node2Id, edge.edgeType, edge.splinePoints, edge.constructMode);

0 commit comments

Comments
 (0)
Please sign in to comment.