/// <summary> /// Assigns the animation time. /// </summary> public void AssignAnimationTime() { m_PlayBackManager.RequestRecord(); if (!m_NoteLayoutGroup.m_ActiveNotes.Any(x => Mathf.Approximately(x.m_TimeSpawned, Time.time))) { Note spawnedNote = Instantiate(m_NoteRef); m_NoteLayoutGroup.m_ActiveNotes.Add(spawnedNote); SetNoteAttributes(spawnedNote); } if (m_PlayBackManager.m_IsRecording) { m_AnimationTimePlayback = Time.time - m_PlayBackManager.m_TimeStarted; Debug.LogFormat("{0} is the normalized time of the current animation", m_BarAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime); AnimationEvent evt; evt = new AnimationEvent(); evt.time = m_AnimationTimePlayback; evt.functionName = "Playback"; evt.intParameter = m_Identifier; m_BarAnimator.runtimeAnimatorController.animationClips[0].AddEvent(evt); } }