Browse Source

Cleanup ERPathAdapter for multi-path creator

master
madc0der 4 years ago
parent
commit
43138c000d
  1. 6
      ERVertexPath/ERMultiRoadPathCreator.cs

6
ERVertexPath/ERMultiRoadPathCreator.cs

@ -118,6 +118,12 @@ namespace ERVertexPath
positionIndex = vertexList.Count; positionIndex = vertexList.Count;
} }
var adapters = gameObject.GetComponents<ERPathAdapter>();
foreach (var adapter in adapters)
{
DestroyImmediate(adapter);
}
unionAdapter = gameObject.AddComponent<ERPathAdapter>(); unionAdapter = gameObject.AddComponent<ERPathAdapter>();
unionAdapter.InitFromData(totalDistance, vertexList.ToArray(), directionsList.ToArray(), unionAdapter.InitFromData(totalDistance, vertexList.ToArray(), directionsList.ToArray(),
normalsList.ToArray(), rotationsList.ToArray(), distanceList.ToArray(), startIndexToRoad); normalsList.ToArray(), rotationsList.ToArray(), distanceList.ToArray(), startIndexToRoad);

Loading…
Cancel
Save