Hi,
I was just reading the TrackClipTypeAttribute source code, and noticed what I’m pretty sure is a bug:
/// <summary>
/// Specifies the type of PlayableAsset that a TrackAsset derived class can create clips of.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class TrackClipTypeAttribute : Attribute
{
/// <summary>
/// The type of the clip class associate with this track
/// </summary>
public readonly Type inspectedType;
/// <summary>
/// Whether to allow automatic creation of these types.
/// </summary>
public readonly bool allowAutoCreate; // true will make it show up in menus
/// <summary>
/// </summary>
/// <param name="clipClass">The type of the clip class to associate with this track. Must derive from PlayableAsset.</param>
public TrackClipTypeAttribute(Type clipClass)
{
inspectedType = clipClass;
allowAutoCreate = true;
}
/// <summary>
/// </summary>
/// <param name="clipClass">The type of the clip class to associate with this track. Must derive from PlayableAsset.</param>
/// <param name="allowAutoCreate">Whether to allow automatic creation of these types. Default value is true.</param>
/// <remarks>Setting allowAutoCreate to false will cause Timeline to not show menu items for creating clips of this type.</remarks>
public TrackClipTypeAttribute(Type clipClass, bool allowAutoCreate)
{
inspectedType = clipClass;
allowAutoCreate = false;
}
}
the last constructor seems to take an argument allowAutoCreate and then plain ignores it ? Very confused