Skip to content

Instantly share code, notes, and snippets.

@TimTheTerribleCS
Created September 19, 2016 17:02
Show Gist options
  • Save TimTheTerribleCS/fd7002bb31f835592ebd2638c247a7d4 to your computer and use it in GitHub Desktop.
Save TimTheTerribleCS/fd7002bb31f835592ebd2638c247a7d4 to your computer and use it in GitHub Desktop.
Change the position of a certain lane prop
var net = "Rail1L";
var netInfo = PrefabCollection<NetInfo>.FindLoaded(net);
if (netInfo.m_lanes != null)
{
foreach (var lane in netInfo.m_lanes)
{
if (lane != null && lane.m_laneProps != null && lane.m_laneProps.m_props != null)
{
foreach (var laneProp in lane.m_laneProps.m_props)
{
if (laneProp != null && laneProp.m_prop != null)
{
if(laneProp.m_prop.name == "RailwayPowerline" || laneProp.m_prop.name == "760273072.Catenary Type NL2A_Data")
{
laneProp.m_position = new Vector3(5,5,5);
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment