Esempio n. 1
0
        void OnStartPreview(PlayableDirector director)
        {
            previewedDirectors = TimelineUtility.GetAllDirectorsInHierarchy(director).ToList();

            if (previewedDirectors == null)
                return;

            m_PreviewedAnimators = TimelineUtility.GetBindingsFromDirectors<Animator>(previewedDirectors).ToList();

            m_PreviewedComponents = new List<IAnimationWindowPreview>();
            foreach (var animator in m_PreviewedAnimators)
            {
                m_PreviewedComponents.AddRange(animator.GetComponents<IAnimationWindowPreview>());
            }
            foreach (var previewedComponent in m_PreviewedComponents)
            {
                previewedComponent.StartPreview();
            }
        }
        void OnStartPreview(PlayableDirector director)
        {
            previewedDirectors = TimelineUtility.GetAllDirectorsInHierarchy(director).ToList();

            if (previewedDirectors == null)
            {
                return;
            }

            m_PreviewedAnimators = TimelineUtility.GetBindingsFromDirectors <Animator>(previewedDirectors).ToList();

            m_PreviewedComponents = m_PreviewedAnimators
                                    .SelectMany(animator => animator.GetComponents <IAnimationWindowPreview>()
                                                .Cast <Component>())
                                    .ToList();

            foreach (var previewedComponent in previewedComponents)
            {
                previewedComponent.StartPreview();
            }
        }