// Adding a new track type // ===================== // Create track class // Make sure to add [System.Serializable] to every class // Set track class properties // Override getTrackType in track class // Add track type to showObjectFieldFor in TimelineWindow // Create an addXTrack method here, and put it in TimelineWindow // Create track key class, make sure to override CreateClone // Create AMXAction class for track class that overrides execute and implements ToString # TO DO # // Override updateCache in track class // Create addKey method in track class, and put it in addKey in TimelineWindow // Add track to timeline action in TimelineWindow // Add inspector properties to showInspectorPropertiesFor in TimelineWindow // Override previewFrame method in track class // Add track object to timelineSelectObjectFor in TimelineWindow (optional) // Override getDependencies and updateDependencies in track class // Add details to Code View # TO DO # #region Tracks // add translation track public void addTrack(int groupId, ITarget target, Transform obj, Track a) { a.setName(getTrackCount()); a.id = getUniqueTrackID(); a.SetTarget(target, obj); addTrack(groupId, a); if (a is CameraSwitcherTrack) { mCameraSwitcher = a as CameraSwitcherTrack; } }
public void deleteTrack(Track track, bool deleteFromGroup = true) { int id = track.id; int index = getTrackIndex(id); if (track != null) { if (mCameraSwitcher == track) { mCameraSwitcher = null; } track.destroy(); } trackValues.RemoveAt(index); if (deleteFromGroup) { deleteTrackFromGroups(id); } sortTracks(); }