// MIT License - Copyright (c) 2025 wallstop
// Full license text: https://github.com/wallstop/unity-helpers/blob/main/LICENSE
namespace WallstopStudios.UnityHelpers.Core.Attributes
{
using System;
using System.Collections.Generic;
///
/// Provides details about the assets that triggered a DetectAssetChanged callback.
///
public sealed class AssetChangeContext
{
public AssetChangeContext(
Type assetType,
AssetChangeFlags flags,
IReadOnlyList createdAssetPaths,
IReadOnlyList deletedAssetPaths
)
{
AssetType = assetType ?? throw new ArgumentNullException(nameof(assetType));
Flags = flags;
CreatedAssetPaths = createdAssetPaths ?? Array.Empty();
DeletedAssetPaths = deletedAssetPaths ?? Array.Empty();
}
public Type AssetType { get; }
public AssetChangeFlags Flags { get; }
public IReadOnlyList CreatedAssetPaths { get; }
public IReadOnlyList DeletedAssetPaths { get; }
public bool HasCreatedAssets => CreatedAssetPaths.Count > 0;
public bool HasDeletedAssets => DeletedAssetPaths.Count > 0;
}
}