public override void OnInspectorGUI() { foreach (Object target in base.targets) { LegacyAnimatorTrack track = target as LegacyAnimatorTrack; if (track == null) { break; } if (!(track.parent is TimelineAsset)) { break; } GUILayout.Label(track.name, EditorStyles.boldLabel); EditorGUILayout.PropertyField(_channelProperty, new GUIContent("Base Animation Channel")); EditorGUILayout.Separator(); GUILayout.Label(new GUIContent("Additional Animation Layers"), EditorStyles.boldLabel); IEnumerable <TrackAsset> childTracks = track.GetChildTracks(); _channelTracks.list = new List <TrackAsset>(childTracks); _channelTracks.DoLayoutList(); _channelTracks.index = -1; } serializedObject.ApplyModifiedProperties(); }
protected virtual void AddChanelToTrack(LegacyAnimatorTrack animatorTrack) { if (animatorTrack != null) { //Work out next free channel to add int channel = _channelProperty.intValue + 1; foreach (LegacyAnimatorTrack track in animatorTrack.GetChildTracks()) { if (track != null) { channel = Mathf.Max(channel, track._animationChannel + 1); } } LegacyAnimatorTrack newTrack = TimelineEditorUtils.CreateChildTrack <LegacyAnimatorTrack>(animatorTrack, "Channel " + channel); newTrack._animationChannel = channel; } }