Last active
May 18, 2022 17:57
-
-
Save ronyx69/adea99e2cd85d0231916679125349e56 to your computer and use it in GitHub Desktop.
Replace target networks with replacement networks. Could break everything idk.
This file contains hidden or 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
// replace all target nets with replacement net | |
var target = PrefabCollection<NetInfo>.FindLoaded("Pedestrian Connection Surface"); | |
var replacement = PrefabCollection<NetInfo>.FindLoaded("Pedestrian Connection"); | |
var b = NetManager.instance.m_segments.m_buffer; | |
for(var i=0;i<b.Length;i++) if(b[i].m_flags!=0) if(b[i].Info==target) b[i].Info=replacement; | |
var b2 = NetManager.instance.m_nodes.m_buffer; | |
for(var i=0;i<b2.Length;i++) if(b2[i].m_flags!=0) if(b2[i].Info==target) b2[i].Info=replacement; | |
for(var i=0;i<b.Length;i++) if(b[i].m_flags!=0) NetManager.instance.UpdateSegment((ushort)i); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment