【Unity编辑器扩展】查找场景和资源内挂载某脚本的所有对象

此编辑器扩展工具脚本主要是快速找到在场景和资源预制体上挂载指定脚本的所有对象,,特别是当我们场景目录结构复杂,想查找所有使用某脚本的物体时使用这个工具。

 

public class AssetPrefabFinder : EditorWindow
{
    static AssetPrefabFinder window;
    //路径可配置
    public string fullPath ="Assets/Resources";
    MonoScript scriptObj = null;
    int loopCount = 0;
    List<Transform> results = new List<Transform>();

    [MenuItem("HSJ/Finder/AssetFinder")]
    static voi

猜你喜欢

转载自blog.csdn.net/qq_37310110/article/details/124378789