Search Unity

Locking a Track through C#?

Discussion in 'Timeline' started by steveEXC, Jan 12, 2018.

  1. steveEXC

    steveEXC

    Joined:
    Nov 7, 2014
    Posts:
    11
    thoward_13 likes this.
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    The property for it on TrackAsset it isn't available to script but you should be able to work around it using serialized properties. E.g.

    var so = new SerializedObject(track);
    so.FindProperty("m_Locked").boolValue = true;
    so.ApplyModifiedProperties();
     
    thoward_13 likes this.