diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
| commit | c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 (patch) | |
| tree | ee4d51c7c1d633e11f46453ef1edd3c77c4ef9f7 /Library/PackageCache/com.unity.timeline@1.2.13/Runtime/ClipCaps.cs | |
| download | Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.gz Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.bz2 Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.zip | |
Inital commit
Diffstat (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Runtime/ClipCaps.cs')
| -rw-r--r-- | Library/PackageCache/com.unity.timeline@1.2.13/Runtime/ClipCaps.cs | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/ClipCaps.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/ClipCaps.cs new file mode 100644 index 0000000..2a5efb6 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/ClipCaps.cs @@ -0,0 +1,85 @@ +using System; +using UnityEngine.Playables; + +namespace UnityEngine.Timeline +{ + /// <summary> + /// Describes the timeline features supported by a clip + /// </summary> + [Flags] + public enum ClipCaps + { + /// <summary> + /// No features are supported. + /// </summary> + None = 0 , + + /// <summary> + /// The clip supports loops. + /// </summary> + Looping = 1 << 0, + + /// <summary> + /// The clip supports clip extrapolation. + /// </summary> + Extrapolation = 1 << 1, + + /// <summary> + /// The clip supports initial local times greater than zero. + /// </summary> + ClipIn = 1 << 2, + + /// <summary> + /// The clip supports time scaling. + /// </summary> + SpeedMultiplier = 1 << 3, + + /// <summary> + /// The clip supports blending between clips. + /// </summary> + Blending = 1 << 4, + + /// <summary> + /// All features are supported. + /// </summary> + All = ~None + } + + static class TimelineClipCapsExtensions + { + public static bool SupportsLooping(this TimelineClip clip) + { + return clip != null && (clip.clipCaps & ClipCaps.Looping) != ClipCaps.None; + } + + public static bool SupportsExtrapolation(this TimelineClip clip) + { + return clip != null && (clip.clipCaps & ClipCaps.Extrapolation) != ClipCaps.None; + } + + public static bool SupportsClipIn(this TimelineClip clip) + { + return clip != null && (clip.clipCaps & ClipCaps.ClipIn) != ClipCaps.None; + } + + public static bool SupportsSpeedMultiplier(this TimelineClip clip) + { + return clip != null && (clip.clipCaps & ClipCaps.SpeedMultiplier) != ClipCaps.None; + } + + public static bool SupportsBlending(this TimelineClip clip) + { + return clip != null && (clip.clipCaps & ClipCaps.Blending) != ClipCaps.None; + } + + public static bool HasAll(this ClipCaps caps, ClipCaps flags) + { + return (caps & flags) == flags; + } + + public static bool HasAny(this ClipCaps caps, ClipCaps flags) + { + return (caps & flags) != 0; + } + } +} |
