// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
namespace FlaxEngine
{
///
/// Specifies a options for an asset reference picker in the editor. Allows to customize view or provide custom value assign policy.
///
///
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public class AssetReferenceAttribute : Attribute
{
///
/// The full name of the asset type to link. Use null or empty to skip it.
///
public string TypeName;
///
/// True if use asset picker with a smaller height (single line), otherwise will use with full icon.
///
public bool UseSmallPicker;
///
/// Initializes a new instance of the class.
///
/// True if use asset picker with a smaller height (single line), otherwise will use with full icon.
public AssetReferenceAttribute(bool useSmallPicker)
{
TypeName = null;
UseSmallPicker = useSmallPicker;
}
///
/// Initializes a new instance of the class.
///
/// The full name of the asset type to link. Use null or empty to skip it.
/// True if use asset picker with a smaller height (single line), otherwise will use with full icon.
public AssetReferenceAttribute(Type typeName = null, bool useSmallPicker = false)
{
TypeName = typeName?.FullName;
UseSmallPicker = useSmallPicker;
}
///
/// Initializes a new instance of the class.
///
/// The full name of the asset type to link. Use null or empty to skip it.
/// True if use asset picker with a smaller height (single line), otherwise will use with full icon.
public AssetReferenceAttribute(string typeName = null, bool useSmallPicker = false)
{
TypeName = typeName;
UseSmallPicker = useSmallPicker;
}
}
}