Search Unity

TrackClipTypeAttribute autocreate ignored ?

Discussion in 'Timeline' started by rickknowles, Oct 4, 2019.

  1. rickknowles

    rickknowles

    Joined:
    Apr 21, 2018
    Posts:
    7
    Hi,

    I was just reading the TrackClipTypeAttribute source code, and noticed what I'm pretty sure is a bug:

    Code (CSharp):
    1.     /// <summary>
    2.     /// Specifies the type of PlayableAsset that a TrackAsset derived class can create clips of.
    3.     /// </summary>
    4.     [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    5.     public class TrackClipTypeAttribute : Attribute
    6.     {
    7.         /// <summary>
    8.         /// The type of the clip class associate with this track
    9.         /// </summary>
    10.         public readonly Type inspectedType;
    11.  
    12.         /// <summary>
    13.         /// Whether to allow automatic creation of these types.
    14.         /// </summary>
    15.         public readonly bool allowAutoCreate; // true will make it show up in menus
    16.  
    17.         /// <summary>
    18.         /// </summary>
    19.         /// <param name="clipClass">The type of the clip class to associate with this track. Must derive from PlayableAsset.</param>
    20.         public TrackClipTypeAttribute(Type clipClass)
    21.         {
    22.             inspectedType = clipClass;
    23.             allowAutoCreate = true;
    24.         }
    25.  
    26.         /// <summary>
    27.         /// </summary>
    28.         /// <param name="clipClass">The type of the clip class to associate with this track. Must derive from PlayableAsset.</param>
    29.         /// <param name="allowAutoCreate">Whether to allow automatic creation of these types. Default value is true.</param>
    30.         /// <remarks>Setting allowAutoCreate to false will cause Timeline to not show menu items for creating clips of this type.</remarks>
    31.         public TrackClipTypeAttribute(Type clipClass, bool allowAutoCreate)
    32.         {
    33.             inspectedType = clipClass;
    34.             allowAutoCreate = false;
    35.         }
    36.     }
    the last constructor seems to take an argument allowAutoCreate and then plain ignores it ? Very confused
     
  2. rickknowles

    rickknowles

    Joined:
    Apr 21, 2018
    Posts:
    7
    (this was in Unity 2019.2.8f1)