UnityEditor.AnimationEventTimeLine.DeleteEvents C# (CSharp) Method

DeleteEvents() private method

private DeleteEvents ( AnimationClip clip, bool deleteIndices ) : void
clip UnityEngine.AnimationClip
deleteIndices bool
return void
        private void DeleteEvents(AnimationClip clip, bool[] deleteIndices)
        {
            bool flag = false;
            List<AnimationEvent> list = new List<AnimationEvent>(AnimationUtility.GetAnimationEvents(clip));
            for (int i = list.Count - 1; i >= 0; i--)
            {
                if (deleteIndices[i])
                {
                    list.RemoveAt(i);
                    flag = true;
                }
            }
            if (flag)
            {
                Undo.RegisterCompleteObjectUndo(clip, "Delete Event");
                AnimationUtility.SetAnimationEvents(clip, list.ToArray());
                this.m_EventsSelected = new bool[list.Count];
                this.m_DirtyTooltip = true;
            }
        }