namespace XGame.Editor.Build.AssetBundles
{
///
/// AssetBundle分类
///
public enum AssetBundleType
{
Addressable = 0x01,
Raw = 0x02,
Dependency = 0x04,
}
///
/// AssetBundle building map entry.
///
public struct AssetBundleData
{
///
/// AssetBundle name.
///
public string assetBundleName;
///
/// AssetBundle variant.
///
public string assetBundleVariant;
///
/// Asset names which belong to the given AssetBundle.
///
public string[] assetNames;
///
/// Addressable name used to load an asset.
///
public string[] addressableNames;
public uint bundleId;
public string originBundleName;
///
/// assetNames全部为贴图为true
///
public bool isTextureBundle;
///
/// AB类型
///
public AssetBundleType bundleType;
public string FullName
{
get
{
if (string.IsNullOrEmpty(assetBundleName))
{
return string.Empty;
}
return string.IsNullOrEmpty(assetBundleVariant) ? assetBundleName : $"{assetBundleName}.{assetBundleVariant}";
}
}
public UnityEditor.AssetBundleBuild ToUniBuild()
{
var build = new UnityEditor.AssetBundleBuild()
{
assetBundleName = assetBundleName,
assetBundleVariant = assetBundleVariant,
assetNames = assetNames,
addressableNames = addressableNames,
};
return build;
}
}
}