Created
September 19, 2016 17:02
-
-
Save TimTheTerribleCS/fd7002bb31f835592ebd2638c247a7d4 to your computer and use it in GitHub Desktop.
Change the position of a certain lane prop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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