Skip to content

Commit

Permalink
fix lane load
Browse files Browse the repository at this point in the history
  • Loading branch information
moelang committed Mar 10, 2020
1 parent f679663 commit 1b1666b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
12 changes: 12 additions & 0 deletions Runtime/Autoware/ADASGo/ADASGoLane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ sealed class ADASGoLane : LineSegment<ADASGoLane>, IADASMapGameObject
{
public GameObject GameObject => gameObject;
public MonoBehaviour MonoBehaviour => this;
ADASGoSlicesLane slices;
public ADASGoSlicesLane Slices
{
get
{
if (slices)
{
slices = GetComponentInParent<ADASGoSlicesLane>();
}
return slices;
}
}
public CollectionADASLane CollectionLane { get; set; }
[HideInInspector] public ADASMapLane.Jct jct;
[HideInInspector] public List<ADASGoLane> bLane;
Expand Down
20 changes: 16 additions & 4 deletions Runtime/Autoware/ADASGo/ADASGoSlicesLane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,26 @@ public void UpdateRef()
child.First().UpdateRef();
child.Last().UpdateRef();
var target = child[0];
if (target.bLane != null)
if (target.bLane != null && target.bLane.Count > 0)
{
bLane = target.bLane.Select(_ => _.GetComponentInParent<ADASGoSlicesLane>()).ToList();
foreach (var item in target.bLane)
{
if (item?.Slices)
{
bLane.Add(item.Slices);
}
}
}
target = child[child.Length - 1];
if (target.fLane != null)
if (target.fLane != null && target.fLane.Count > 0)
{
fLane = target.fLane.Select(_ => _.GetComponentInParent<ADASGoSlicesLane>()).ToList();
foreach (var item in target.fLane)
{
if (item?.Slices)
{
fLane.Add(item.Slices);
}
}
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.autocore.map-toolbox",
"displayName": "Autoware Map Toolbox",
"version": "0.0.10-preview.4",
"version": "0.0.10-preview.5",
"unity": "2019.3",
"description": "Map tools for Autoware",
"dependencies": {
Expand Down

0 comments on commit 1b1666b

Please sign in to comment.