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/Editor/Utilities/ControlPlayableUtility.cs | |
| 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/Editor/Utilities/ControlPlayableUtility.cs')
| -rw-r--r-- | Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/ControlPlayableUtility.cs | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/ControlPlayableUtility.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/ControlPlayableUtility.cs deleted file mode 100644 index d7023e4..0000000 --- a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/ControlPlayableUtility.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Collections.Generic; -using UnityEngine.Playables; -using UnityEngine.Timeline; - -namespace UnityEditor.Timeline -{ - static class ControlPlayableUtility - { - public static bool DetectCycle( - ControlPlayableAsset asset, PlayableDirector director, HashSet<PlayableDirector> set = null) - { - if (director == null || asset == null || !asset.updateDirector) - return false; - - if (set == null) - set = new HashSet<PlayableDirector>(); - - if (set.Contains(director)) - return true; - - var gameObject = asset.sourceGameObject.Resolve(director); - if (gameObject == null) - return false; - - set.Add(director); - - foreach (var subDirector in asset.GetComponent<PlayableDirector>(gameObject)) - { - foreach (var childAsset in GetPlayableAssets(subDirector)) - { - if (DetectCycle(childAsset, subDirector, set)) - return true; - } - } - - set.Remove(director); - - return false; - } - - public static IEnumerable<ControlPlayableAsset> GetPlayableAssets(PlayableDirector director) - { - var timeline = director != null ? (director.playableAsset as TimelineAsset) : null; - if (timeline != null) - { - foreach (var t in timeline.GetOutputTracks()) - { - var controlTrack = t as ControlTrack; - if (controlTrack != null) - { - foreach (var c in t.GetClips()) - { - var asset = c.asset as ControlPlayableAsset; - if (asset != null) - yield return asset; - } - } - } - } - } - } -} |
