From ae186964a23bc69462c7fc404b62eefb75980d9d Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 12 Jan 2022 16:01:56 +0100 Subject: [PATCH] [unity] Timeline: Removed editor warning when SpineAnimationStateTrack 'Track Index' is identical at different tracks, different skeleton objects can be targeted. Timeline API prevents a target object check. See commit 7db783c. --- .../SpineAnimationStateTrack.cs | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateTrack.cs b/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateTrack.cs index 5c69f6637..502234ee9 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateTrack.cs +++ b/spine-unity/Modules/com.esotericsoftware.spine.timeline/Runtime/SpineAnimationState/SpineAnimationStateTrack.cs @@ -48,39 +48,9 @@ namespace Spine.Unity.Playables { } var scriptPlayable = ScriptPlayable.Create(graph, inputCount); -#if UNITY_EDITOR - WarnIfDuplicateTrackIndex(); -#endif var mixerBehaviour = scriptPlayable.GetBehaviour(); mixerBehaviour.trackIndex = this.trackIndex; return scriptPlayable; } - -#if UNITY_EDITOR - static float lastWarningTime = 0; - - public void WarnIfDuplicateTrackIndex () { - if (Time.frameCount == lastWarningTime) // only warn once. - return; - lastWarningTime = Time.frameCount; - - var rootTracks = timelineAsset.GetRootTracks(); - List trackIndices = new List(); - int trackFromTop = -1; // first invisible track is marker track, skipped. - foreach (var track in rootTracks) { - ++trackFromTop; - if (track.GetType() != typeof(SpineAnimationStateTrack)) - continue; - var animationStateTrack = (SpineAnimationStateTrack)track; - int trackIndex = animationStateTrack.trackIndex; - if (trackIndices.Contains(trackIndex)) { - Debug.LogWarning(string.Format("Please change the 'Track Index' Inspector property " + - "at Track number {0} from the top, both tracks are setting animations at track index '{1}'.", - trackFromTop, trackIndex)); - } else - trackIndices.Add(trackIndex); - } - } -#endif } }