Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Using a list on a custom Timeline track in a newer editor

Discussion in 'Timeline' started by epc812, Jun 25, 2023.

  1. epc812

    epc812

    Joined:
    Aug 8, 2022
    Posts:
    8
    Hello,

    I’m trying to add a list to a custom track. I was able to use a list in a custom clip in editor 2021.3.22f1 and I was able to use a list in a custom track in editor 2019.4.1f1.
    But when I try to add a list to a custom track in 2021.3.22f1, I get an empty array

    Here is the code I tried for both versions


    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.Playables;
    using UnityEngine.Timeline;

    [TrackColor(0.855f, 0.903f, 0.87f)]
    [TrackClipType(typeof(DialogueClip))]
    [TrackBindingType(typeof(GameObject))]
    public class DialogueTrack : TrackAsset
    {
    public List<GameObject> gameObjectsTwo = new List<GameObject>(new GameObject[10]);
    public GameObject gameObject;
    public bool thing;


    }


    How it looks in 2019.4.1f1


    How it looks in 2021.3.22f1


    And this is what I copied from the list variable (Game Objects Two) in editor 2021.3.22f1:

     
  2. epc812

    epc812

    Joined:
    Aug 8, 2022
    Posts:
    8
    It turned out it was a bug. If the first variable was a list, you wouldn't be able to set it.
     
    Yuchen_Chang likes this.