summaryrefslogtreecommitdiff
path: root/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Animation/AnimationPlayableAssetEditor.cs
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-08-20 23:40:50 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-08-20 23:40:50 -0400
commit3af4c218c0e70167db23a6303d2af30aff37d2fe (patch)
tree927f29edcf54ab562f40f3d1c6cb69287c7f5980 /Library/PackageCache/com.unity.timeline@1.2.13/Editor/Animation/AnimationPlayableAssetEditor.cs
parentb6daed0af784f4e9bc13329dd87c671b06ee1c65 (diff)
downloadProject-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/Animation/AnimationPlayableAssetEditor.cs')
-rw-r--r--Library/PackageCache/com.unity.timeline@1.2.13/Editor/Animation/AnimationPlayableAssetEditor.cs65
1 files changed, 0 insertions, 65 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Animation/AnimationPlayableAssetEditor.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Animation/AnimationPlayableAssetEditor.cs
deleted file mode 100644
index e4bebc1..0000000
--- a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Animation/AnimationPlayableAssetEditor.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using JetBrains.Annotations;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-namespace UnityEditor.Timeline
-{
- [CustomTimelineEditor(typeof(AnimationPlayableAsset)), UsedImplicitly]
- class AnimationPlayableAssetEditor : ClipEditor
- {
- public static readonly string k_NoClipAssignedError = LocalizationDatabase.GetLocalizedString("No animation clip assigned");
- public static readonly string k_LegacyClipError = LocalizationDatabase.GetLocalizedString("Legacy animation clips are not supported");
- static readonly string k_MotionCurveError = LocalizationDatabase.GetLocalizedString("You are using motion curves without applyRootMotion enabled on the Animator. The root transform will not be animated");
- static readonly string k_RootCurveError = LocalizationDatabase.GetLocalizedString("You are using root curves without applyRootMotion enabled on the Animator. The root transform will not be animated");
-
- /// <inheritdoc/>
- public override ClipDrawOptions GetClipOptions(TimelineClip clip)
- {
- var clipOptions = base.GetClipOptions(clip);
- var asset = clip.asset as AnimationPlayableAsset;
-
- if (asset != null)
- clipOptions.errorText = GetErrorText(asset, clip.parentTrack as AnimationTrack, clipOptions.errorText);
-
- if (clip.recordable)
- clipOptions.highlightColor = DirectorStyles.Instance.customSkin.colorAnimationRecorded;
-
- return clipOptions;
- }
-
- /// <inheritdoc />
- public override void OnCreate(TimelineClip clip, TrackAsset track, TimelineClip clonedFrom)
- {
- var asset = clip.asset as AnimationPlayableAsset;
- if (asset != null && asset.clip != null && asset.clip.legacy)
- {
- asset.clip = null;
- Debug.LogError("Legacy Animation Clips are not supported");
- }
- }
-
- string GetErrorText(AnimationPlayableAsset animationAsset, AnimationTrack track, string defaultError)
- {
- if (animationAsset.clip == null)
- return k_NoClipAssignedError;
- if (animationAsset.clip.legacy)
- return k_LegacyClipError;
- if (animationAsset.clip.hasMotionCurves || animationAsset.clip.hasRootCurves)
- {
- if (track != null && track.trackOffset == TrackOffset.Auto)
- {
- var animator = track.GetBinding(TimelineEditor.inspectedDirector);
- if (animator != null && !animator.applyRootMotion && !animationAsset.clip.hasGenericRootTransform)
- {
- if (animationAsset.clip.hasMotionCurves)
- return k_MotionCurveError;
- return k_RootCurveError;
- }
- }
- }
-
- return defaultError;
- }
- }
-}