using System;
namespace DTT.PublishingTools.Attributes
{
///
/// Marks a scriptable object as DTT asset, ensuring it always has an asset instance
/// in the DTT project folder.
///
public class DTTAssetAttribute : Attribute
{
///
/// The full package name of the package the asset belongs to.
///
public readonly string fullPackageName;
///
/// Whether the asset uses the resources folder to be loaded.
///
public readonly bool isResource;
///
/// The custom relative directory path from the package folder. DTT/packageDisplayName/relativePath.
/// Should include the .asset extension if the asset name is included in the path.
///
public readonly string relativePath;
///
/// A custom name used for the asset to be created. Should include the .asset extension.
///
public readonly string assetName;
///
/// Creates a new instance of the attribute.
///
/// The full package name of the package the asset belongs to.
/// Whether the asset uses the resources folder to be loaded.
public DTTAssetAttribute(string fullPackageName, bool isResource)
{
this.fullPackageName = fullPackageName;
this.isResource = isResource;
}
///
/// Creates a new instance of the attribute.
///
/// The full package name of the package the asset belongs to.
/// A custom name used for the asset to be created. Should include the .asset extension.
/// Whether the asset uses the resources folder to be loaded.
public DTTAssetAttribute(string fullPackageName, string assetName, bool isResource)
{
this.fullPackageName = fullPackageName;
this.assetName = assetName;
this.isResource = isResource;
}
///
/// Creates a new instance of the attribute.
///
/// The full package name of the package the asset belongs to.
/// The custom relative directory path from the package folder. DTT/packageDisplayName/relativePath.
/// Should include the .asset extension if the asset name is included in the path.
public DTTAssetAttribute(string fullPackageName, string relativePath)
{
this.fullPackageName = fullPackageName;
this.relativePath = relativePath;
}
}
}