c# - Cities Skylines Modding Remove all trees -
i not sure how it.
foreach (uint tree in treestodelete.m_trees) { ????? }
or
for (int = 0; < treemanager.m_treecount; i++) { var tree = treemanager.instance.m_trees[i]; treemanager.instance.releasetree(tree); }
don't know how finish first 1 , these errors when use second.
an object reference required access non-static member treemanager.m_treecount cannot apply indexing [] expression of type array32 best overloaded method match treemanager.releasetree(uint) has invalid arguments
thanks giving error. you're getting 2 errors there:
an object reference required access non-static member treemanager.m_treecount'
you need initialise treemanager class. an object reference required access non-static member
var treemanager = new treemanager();
i'm not sure if takes constructor arguments. should help.
you can access so:
var treemanager = new treemanager(); (int = 0; < treemanager.m_treecount; i++) { var tree = treemanager.instance.m_trees[i]; treemanager.instance.releasetree(tree); }
your second error:
cannot apply indexing [] expression of typearray32' best overloaded method match `treemanager.releasetree(uint)' has invalid arguments
i think it's linked fact treemanager wasn't initialised, see here: error 1 cannot apply indexing [] expression of type 'int'
here piece of documentation the api: https://github.com/cities-skylines/assembly-csharp/wiki/treemanager
Comments
Post a Comment