Unity脚本查询

public class FindScript
{
    [MenuItem("Tools/脚本查找")]
    static void Find()
    {
        Find(rType: "t:prefab");
    }
    static List Find(string rType)
    {
        List resultList = new List();
        string[] prefabs = AssetDatabase.FindAssets(rType);
        foreach (var path in prefabs)
        {
            GameObject prefab = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(path));
            var result = prefab.GetComponentsInChildren();
            if (result != null && result.Length > 0)
            {
                Debug.Log(prefab.name);
                resultList.Add(prefab.name);
            }
        }
        return resultList;
    }
}

你可能感兴趣的:(windows,服务器,linux)