void OnDetachFromPanel(DetachFromPanelEvent evt)
        {
            UnregisterCallback <DetachFromPanelEvent>(OnDetachFromPanel);
            UnregisterCallback <DragUpdatedEvent>(OnDragUpdate);
            UnregisterCallback <DragPerformEvent>(OnDragPerform);

            AnimationClipPostprocessor.RemoveOnImport(MarkClipListsForUpdate);
            AnimationClipPostprocessor.RemoveOnDelete(MarkClipListsForUpdate);
        }
        void OnAttachToPanel(AttachToPanelEvent evt)
        {
            RegisterCallback <DragUpdatedEvent>(OnDragUpdate);
            RegisterCallback <DragPerformEvent>(OnDragPerform);
            RegisterCallback <DetachFromPanelEvent>(OnDetachFromPanel);

            AnimationClipPostprocessor.AddOnImport(MarkClipListsForUpdate);
            AnimationClipPostprocessor.AddOnDelete(MarkClipListsForUpdate);
        }
Beispiel #3
0
        public void Dispose()
        {
            foreach (var marker in markers)
            {
                marker.Dispose();
            }

            markers.Clear();

            foreach (var tag in tags)
            {
                tag.Dispose();
            }

            tags.Clear();

            AnimationClipPostprocessor.RemoveOnImport(m_AnimationClipGuid, ReloadClipAndMarkDirty);
            AnimationClipPostprocessor.RemoveOnDelete(m_AnimationClipGuid, OnDeleteClip);
        }
Beispiel #4
0
        void SetClip(AnimationClip clip)
        {
            if (clip == null)
            {
                m_Clip = null;
                return;
            }

            AnimationClipPostprocessor.RemoveOnImport(m_AnimationClipGuid, ReloadClipAndMarkDirty);
            AnimationClipPostprocessor.RemoveOnDelete(m_AnimationClipGuid, OnDeleteClip);

            m_AnimationClipGuid = SerializableGuidUtility.GetSerializableGuidFromAsset(clip);

            AnimationClipPostprocessor.AddOnImport(m_AnimationClipGuid, ReloadClipAndMarkDirty);
            AnimationClipPostprocessor.AddOnDelete(m_AnimationClipGuid, OnDeleteClip);

            m_Clip = clip;
            m_CachedClipVersion  = AnimationClipPostprocessor.GetClipVersion(clip);
            m_CachedClipName     = clip.name;
            m_CachedClipDuration = Utility.ComputeAccurateClipDuration(clip);
            m_CachedSampleRate   = clip.frameRate;
        }
 internal void OnDeserialize()
 {
     AnimationClipPostprocessor.AddOnImport(m_AnimationClipGuid, ReloadClipAndMarkDirty);
     AnimationClipPostprocessor.AddOnDelete(m_AnimationClipGuid, OnDeleteClip);
 }