📌  相关文章
📜  unity 查找某个类型的所有可编写脚本的对象 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:44.086000             🧑  作者: Mango

代码示例2
public class CharacterList
    {
        List characterList = new List();

        void PopulateList()
        {
            string[] assetNames = AssetDatabase.FindAssets("Your_Filter", new[] { "Assets/YourFolder" });
            characterList.Clear();
            foreach (string SOName in assetNames)
            {
                var SOpath    = AssetDatabase.GUIDToAssetPath(SOName);
                var character = AssetDatabase.LoadAssetAtPath(SOpath);
                characterList.Add(character);
            }
        }
    }