public void AddEvent(float time, GameObject rootGameObject, AnimationClip animationClip) { AnimationWindowEvent evt = AnimationWindowEvent.CreateAndEdit(rootGameObject, animationClip, time); this.Select(evt); }
private void AddEventButtonOnGUI() { using (new EditorGUI.DisabledScope(!selection.animationIsEditable)) { if (GUILayout.Button(AnimationWindowStyles.addEventContent, EditorStyles.toolbarButton)) { m_Events.AddEvent(m_State.currentTime, selection.rootGameObject, selection.animationClip); } } }