Last active
November 15, 2020 23:21
-
-
Save ronyx69/7c0ab719ef67996735f76546cebc044a to your computer and use it in GitHub Desktop.
Lists all networks in a text file.
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
var prefabNames = new List<string>(); | |
for (uint i = 0; i < PrefabCollection<NetInfo>.LoadedCount(); i++) | |
{ | |
var prefab = PrefabCollection<NetInfo>.GetLoaded(i); | |
if (prefab == null) continue; | |
Debug.Log(prefab); | |
prefabNames.Add(prefab.ToString()); | |
} | |
prefabNames.Sort(); | |
var s="\n"; | |
foreach(var name in prefabNames) | |
{ | |
s = s + name + "\n"; | |
} | |
var path = Path.Combine(ColossalFramework.IO.DataLocation.addonsPath, "NetworksList.txt"); | |
File.WriteAllText(path, s); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment