Last active
January 20, 2020 02:45
-
-
Save boformer/73fc9b24b2317dd8f12ec67498aa0296 to your computer and use it in GitHub Desktop.
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_netLayers = 512; | |
prefab.m_maxPropDistance = 1000f; | |
foreach (var segment in prefab.m_segments) | |
{ | |
segment.m_layer = 9; | |
if (segment.m_segmentMaterial != null) | |
{ | |
segment.m_segmentMaterial.shader = Shader.Find("Custom/Net/Road"); | |
} | |
} | |
foreach (var node in prefab.m_nodes) | |
{ | |
node.m_layer = 9; | |
if (node.m_nodeMaterial != null) | |
{ | |
node.m_nodeMaterial.shader = Shader.Find("Custom/Net/Road"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment