Created
April 10, 2019 20:20
-
-
Save boformer/dc774522f795682da31bd77d58452a72 to your computer and use it in GitHub Desktop.
Make Pedestrian Connections ingame editable/visible
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 prefabNames = new string[] | |
{ | |
"Pedestrian Connection", | |
"Pedestrian Connection Surface", | |
"Pedestrian Connection Inside", | |
"Pedestrian Connection Underground" | |
}; | |
foreach (var prefabName in prefabNames) | |
{ | |
var prefab = PrefabCollection<NetInfo>.FindLoaded(prefabName); | |
prefab.m_class.m_layer = ItemClass.Layer.Default; | |
//prefab.m_createPavement = true; | |
prefab.m_netLayers = 512; | |
prefab.m_hasTerrainHeightProps = true; | |
prefab.m_maxPropDistance = 1000f; | |
var laneProps = prefab.m_lanes[0].m_laneProps = ScriptableObject.CreateInstance<NetLaneProps>(); | |
laneProps.m_props = new NetLaneProps.Prop[1]; | |
laneProps.m_props[0] = new NetLaneProps.Prop() | |
{ | |
m_prop = PrefabCollection<PropInfo>.FindLoaded("Barrel 01"), | |
m_finalProp = PrefabCollection<PropInfo>.FindLoaded("Barrel 01"), | |
m_flagsRequired = NetLane.Flags.Created, | |
m_probability = 100, | |
m_repeatDistance = 2, | |
//m_segmentOffset = -1, | |
m_position = new Vector3(0, 0f, 0) | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment