//----------------------------------------------------------------------------------------------------------------------
        void DrawPreviewImage(ref PreviewDrawInfo drawInfo, TimelineClip clip, StreamingImageSequencePlayableAsset sisAsset)
        {
            int imageIndex = sisAsset.LocalTimeToImageIndex(clip, drawInfo.LocalTime);

            IList <string> imageFileNames = sisAsset.GetImageFileNames();

            //Load
            string imagePath = sisAsset.GetImageFilePath(imageIndex);

            ImageLoader.GetImageDataInto(imagePath, StreamingImageSequenceConstants.IMAGE_TYPE_PREVIEW
                                         , out ImageData readResult);

            switch (readResult.ReadStatus)
            {
            case StreamingImageSequenceConstants.READ_STATUS_LOADING:
                break;

            case StreamingImageSequenceConstants.READ_STATUS_SUCCESS: {
                Texture2D tex = PreviewTextureFactory.GetOrCreate(imagePath, ref readResult);
                if (null != tex)
                {
                    Graphics.DrawTexture(drawInfo.DrawRect, tex);
                }
                break;
            }

            default: {
                ImageLoader.RequestLoadPreviewImage(imagePath, (int)drawInfo.DrawRect.width, (int)drawInfo.DrawRect.height);
                break;
            }
            }
        }
Пример #2
0
//----------------------------------------------------------------------------------------------------------------------
        protected override void DrawPreviewImageV(ref PreviewDrawInfo drawInfo, TimelineClip clip,
                                                  ImageFolderPlayableAsset <SISClipData> playableAsset)
        {
            StreamingImageSequencePlayableAsset sisAsset = playableAsset as StreamingImageSequencePlayableAsset;

            Assert.IsNotNull(sisAsset);

            int    imageIndex = sisAsset.LocalTimeToImageIndex(clip, drawInfo.LocalTime);
            string imagePath  = sisAsset.GetImageFilePath(imageIndex);

            PreviewUtility.DrawPreviewImage(ref drawInfo, imagePath);
        }