diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-08-20 23:40:50 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-08-20 23:40:50 -0400 |
| commit | 3af4c218c0e70167db23a6303d2af30aff37d2fe (patch) | |
| tree | 927f29edcf54ab562f40f3d1c6cb69287c7f5980 /Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Extensions | |
| parent | b6daed0af784f4e9bc13329dd87c671b06ee1c65 (diff) | |
| download | Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.gz Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.bz2 Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.zip | |
Removed a bunch of stuff; Changes
Diffstat (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Extensions')
| -rw-r--r-- | Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Extensions/TrackExtensions.cs | 76 | ||||
| -rw-r--r-- | Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Extensions/TrackExtensions.cs.meta | 11 |
2 files changed, 0 insertions, 87 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Extensions/TrackExtensions.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Extensions/TrackExtensions.cs deleted file mode 100644 index 87eec1b..0000000 --- a/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Extensions/TrackExtensions.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using UnityEngine; -using UnityEngine.Timeline; -using UnityEngine.Playables; - -namespace UnityEngine.Timeline -{ - /// <summary> - /// Extension methods for TrackAssets - /// </summary> - public static class TrackAssetExtensions - { - /// <summary> - /// Gets the GroupTrack this track belongs to. - /// </summary> - /// <param name="asset">The track asset to find the group of</param> - /// <returns>The parent GroupTrack or null if the Track is an override track, or root track.</returns> - public static GroupTrack GetGroup(this TrackAsset asset) - { - if (asset == null) - return null; - - return asset.parent as GroupTrack; - } - - /// <summary> - /// Assigns the track to the specified group track. - /// </summary> - /// <param name="asset">The track to assign.</param> - /// <param name="group">The GroupTrack to assign the track to.</param> - /// <remarks> - /// Does not support assigning to a group in a different timeline. - /// </remarks> - public static void SetGroup(this TrackAsset asset, GroupTrack group) - { - const string undoString = "Reparent"; - - if (asset == null || asset == group || asset.parent == group) - return; - - if (group != null && asset.timelineAsset != group.timelineAsset) - throw new InvalidOperationException("Cannot assign to a group in a different timeline"); - - - TimelineUndo.PushUndo(asset, undoString); - - var timeline = asset.timelineAsset; - var parentTrack = asset.parent as TrackAsset; - var parentTimeline = asset.parent as TimelineAsset; - if (parentTrack != null || parentTimeline != null) - { - TimelineUndo.PushUndo(asset.parent, undoString); - if (parentTimeline != null) - { - parentTimeline.RemoveTrack(asset); - } - else - { - parentTrack.RemoveSubTrack(asset); - } - } - - if (group == null) - { - TimelineUndo.PushUndo(timeline, undoString); - asset.parent = asset.timelineAsset; - timeline.AddTrackInternal(asset); - } - else - { - TimelineUndo.PushUndo(group, undoString); - group.AddChild(asset); - } - } - } -} diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Extensions/TrackExtensions.cs.meta b/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Extensions/TrackExtensions.cs.meta deleted file mode 100644 index 823e94a..0000000 --- a/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Extensions/TrackExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d3721d5c6afa8e545995dfaada328476 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: |
