Files
Fishing2NetTest/Assets/Scripts/NBC/Asset/Runtime/Address/Info/BundleInfo.cs
2026-03-05 18:07:55 +08:00

44 lines
1.1 KiB
C#

using UnityEngine;
namespace NBC.Asset
{
public class BundleInfo
{
public readonly BundleData Bundle;
public BundleLoadMode LoadMode;
public BundleInfo(BundleData bundleData)
{
Bundle = bundleData;
}
/// <summary>
/// 资源地址
/// </summary>
public string BundlePath
{
get
{
if (LoadMode == BundleLoadMode.LoadFromStreaming)
{
Debug.Log($"LoadMode={LoadMode} path+{Bundle.StreamingFilePath}");
return Bundle.StreamingFilePath;
}
if (LoadMode == BundleLoadMode.LoadFromCache)
{
Debug.Log($"LoadMode={LoadMode} path+{Bundle.CachedDataFilePath}");
return Bundle.CachedDataFilePath;
}
if (LoadMode == BundleLoadMode.LoadFromRemote)
{
return Bundle.RemoteDataFilePath;
}
return string.Empty;
}
}
}
}