void OnAttachToPanel(AttachToPanelEvent evt)
        {
            RegisterCallback <DragUpdatedEvent>(OnDragUpdate);
            RegisterCallback <DragPerformEvent>(OnDragPerform);
            RegisterCallback <DetachFromPanelEvent>(OnDetachFromPanel);

            AnimationClipPostprocessor.AddOnImport(MarkClipListsForUpdate);
            AnimationClipPostprocessor.AddOnDelete(MarkClipListsForUpdate);
        }
Example #2
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);
 }