Search Unity

Is there any way I can get locked track ?

Discussion in 'Timeline' started by Suika, Jan 19, 2018.

  1. Suika

    Suika

    Joined:
    Nov 19, 2013
    Posts:
    33
    Hi

    Is there any way I can get locked track ?

    There only "muted" and "isSubTrack" in TrackAsset

    thx
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    The property is not public - it should be.

    You can access it using SerializedObjects and SerializedProperties (the property name is m_Locked).
     
  3. Suika

    Suika

    Joined:
    Nov 19, 2013
    Posts:
    33
    I'm Sorry for my poor English. I not quite understand what you mean.

    Do you mean : convert TrackAsset to SerializedObjects or SerializedProperties to access m_Locked?
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Here's some sample code to clarify:

    Code (CSharp):
    1.             var serializedObject = new SerializedObject(track);
    2.             var serializedProp = serializedObject.FindProperty("m_Locked");
    3.             serializedProp.boolValue = true;
    4.             serializedObject.ApplyModifiedProperties();