/// <summary> /// Calls <see cref="Destroy(AnimationClip)"/> on all states gathered by /// <see cref="IAnimationClipCollection.GatherAnimationClips"/>. /// </summary> public void DestroyAll(IAnimationClipCollection source) { if (source == null) { return; } var clips = ObjectPool.AcquireSet <AnimationClip>(); source.GatherAnimationClips(clips); DestroyAll(clips); ObjectPool.Release(clips); }
#pragma warning restore UNT0006 // Incorrect message signature. /************************************************************************************************************************/ /// <summary>[<see cref="IAnimationClipSource"/>] /// Calls <see cref="GatherAnimationClips(ICollection{AnimationClip})"/>. /// </summary> public void GetAnimationClips(List <AnimationClip> clips) { var set = ObjectPool.AcquireSet <AnimationClip>(); set.UnionWith(clips); GatherAnimationClips(set); clips.Clear(); clips.AddRange(set); ObjectPool.Release(set); }
/// <summary> /// Calls <see cref="Destroy(AnimationClip)"/> on all states gathered by /// <see cref="IAnimationClipCollection.GatherAnimationClips"/>. /// </summary> public void DestroyAll(IAnimationClipCollection source) { if (source == null) { return; } var clips = ObjectPool.AcquireSet <AnimationClip>(); foreach (var clip in clips) { Destroy(clip); } ObjectPool.Release(clips); }
/************************************************************************************************************************/ /// <summary> /// Checks if any <see cref="AnimationClip"/> in the `source` has an animation event with the specified /// `functionName`. /// </summary> public static bool HasEvent(IAnimationClipCollection source, string functionName) { var clips = ObjectPool.AcquireSet <AnimationClip>(); source.GatherAnimationClips(clips); foreach (var clip in clips) { if (HasEvent(clip, functionName)) { ObjectPool.Release(clips); return(true); } } ObjectPool.Release(clips); return(false); }