public void OnAddTagSelection(Type tagType, float startTime, float duration = -1f) { if (m_Mode == TimelineViewMode.frames) { startTime = (float)TimelineUtility.RoundToFrame(startTime, TaggedClip.SampleRate); if (duration >= 0) { duration = (float)TimelineUtility.RoundToFrame(duration, TaggedClip.SampleRate); } } TaggedClip.AddTag(tagType, startTime, duration); TargetAsset.MarkDirty(); }
void OnAddSelection(Type type) { if (type != null && TaggedClip != null) { if (TagAttribute.IsTagType(type)) { OnAddTagSelection(type, ActiveTime); } else if (MarkerAttribute.IsMarkerType(type)) { TaggedClip.AddMarker(type, ActiveTime); TargetAsset.MarkDirty(); } TaggedClip.NotifyChanged(); } }