ActivationTrackInspector.cs
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using UnityEngine;
using UnityEngine.Timeline;
namespace UnityEditor.Timeline
{
[CustomEditor(typeof(ActivationTrack))]
class ActivationTrackInspector : TrackAssetInspector
{
static class Styles
{
public static readonly GUIContent PostPlaybackStateText = EditorGUIUtility.TrTextContent("Post-playback state");
}
SerializedProperty m_PostPlaybackProperty;
public override void OnInspectorGUI()
{
using (new EditorGUI.DisabledScope(IsTrackLocked()))
{
serializedObject.Update();
EditorGUI.BeginChangeCheck();
if (m_PostPlaybackProperty != null)
EditorGUILayout.PropertyField(m_PostPlaybackProperty, Styles.PostPlaybackStateText);
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
var activationTrack = target as ActivationTrack;
if (activationTrack != null)
activationTrack.UpdateTrackMode();
}
}
}
public override void OnEnable()
{
base.OnEnable();
m_PostPlaybackProperty = serializedObject.FindProperty("m_PostPlaybackState");
}
}
}