public void SetClip(TaggedAnimationClip taggedClip, bool updateTimeRange = true)
        {
            ClearSelection();

            m_ClipLengthBar.style.display = DisplayStyle.None;
            m_ActiveTimeField.SetEnabled(false);

            TaggedClip = taggedClip;

            foreach (var tt in m_TrackElements)
            {
                tt.SetClip(TaggedClip);
            }

            if (TaggedClip == null || TargetAsset == null)
            {
                SetFPSLabelText();

                m_TimeRuler.SetIMGUIVisible(false);
                m_ClipArea.style.visibility   = Visibility.Hidden;
                m_ActiveTick.style.visibility = Visibility.Hidden;

                return;
            }

            m_TimeRuler.SetIMGUIVisible(true);
            m_ActiveTick.style.visibility = Visibility.Visible;
            m_ClipArea.style.visibility   = Visibility.Visible;
            TaggedClip.MarkerAdded       += ShowMarkerTrack;
            TaggedClip.DataChanged       += AdjustTagBackgrounds;

            if (updateTimeRange)
            {
                UpdateTimeRange();
            }

            SelectionContainer.Select(TaggedClip); // display specific information from the clip in the inspector, like the retarget source avatar, even if no tags/markers have been selected yet
            Selection.activeObject = SelectionContainer;

            if (!TaggedClip.Valid)
            {
                SetFPSLabelText();
                return;
            }

            PreviewActiveTime();

            SetFPSLabelText();

            AdjustTicks();

            m_ClipLengthBar.style.display = DisplayStyle.Flex;

            m_ActiveTimeField.SetEnabled(true);

            ResetTimeRuler();
        }
        public void Select(ITimelineElement selection, bool multi)
        {
            if (!multi)
            {
                ClearSelection();
                SelectionContainer.Clear();
            }

            SelectionContainer.Select(selection, TaggedClip);
            Selection.activeObject = SelectionContainer;
        }
Example #3
0
        public Task <TFile> SetSelectedAsync(TFile file, CancellationToken ct = default(CancellationToken))
        {
            if (file != null)
            {
                var items = Items;
                var item  = items.FirstOrDefault(f => f.Id == file.Id);
                if (item != null)
                {
                    SelectedItem = item;
                    SelectionContainer.Select(item);
                }
                return(Task.FromResult(item));
            }

            return(Task.FromResult(default(TFile)));
        }