rr_doot/BundleBuilder/Assets/DontBuildThis/Scripts/BundleChecker.cs

35 lines
822 B
C#
Raw Normal View History

2024-02-20 17:03:40 +00:00
using System.IO;
using UnityEditor;
using UnityEngine;
#if UNITY_EDITOR
public class BundleChecker : MonoBehaviour
{
public string BundleFolder;
public void CheckEm()
{
// var bundlePaths = Directory.GetFiles(Application.dataPath + "/ToCheck");
var bundlePaths = Directory.GetFiles(BundleFolder);
foreach (var bp in bundlePaths)
{
var extension = Path.GetExtension(bp);
if (extension == ".meta" || extension == ".manifest")
{
continue;
}
var assBun = AssetBundle.LoadFromFile(bp);
Debug.Log(assBun.name);
foreach (var assName in assBun.GetAllAssetNames())
{
Debug.Log(assName);
}
}
}
}
#endif