obsidian/笔记文件/2.笔记/GetAllAssetBundleNames.md
2025-03-26 00:02:56 +08:00

630 B

#unity/日常积累

AssetDatabase.GetAllAssetBundleNames

public static string[] GetAllAssetBundleNames ();

返回

string[] 资源捆绑包名称数组。

描述

返回资源数据库中所有的 AssetBundle 名称。

using UnityEditor;
using UnityEngine;

public class GetAssetBundleNames
{
    [MenuItem("Assets/Get Asset Bundle names")]
    static void GetNames()
    {
        var names = AssetDatabase.GetAllAssetBundleNames();
        foreach (string name in names)
            Debug.Log("Asset Bundle: " + name);
    }
}