[英]How do I loop over all Assets folders and sub folders and get to a list all the prefabs in this folders?
[英]How to list all the folders and sub folders in a directory without using recursion
請告訴我如何編寫程序以列出目錄中的所有文件夾和子文件夾,而無需使用遞歸和任何庫函數。(在C#中)?
var dirList = Directory.GetDirectories("directotyPath", "*", SearchOption.AllDirectories);
這將返回給定directotyPath
中的所有目錄。
如果您不想使用遞歸列出所有目錄,則堆棧或隊列都可以與搜索算法配合使用。
這是使用堆棧的需求說明。 解決方案使用Java,您可以了解工作流程並將其自己轉換為c#
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.