Esempio n. 1
0
//----------------------------------------------------------------------------------------------------------------------

#if UNITY_EDITOR
        #region Reload/Find images
        internal void Reload(string folderMD5 = null)
        {
            if (string.IsNullOrEmpty(m_folder))
            {
                return;
            }

            //Unload existing images
            if (HasImages())
            {
                foreach (string fileName in m_imageFileNames)
                {
                    string imagePath = PathUtility.GetPath(m_folder, fileName);
                    StreamingImageSequencePlugin.UnloadImageAndNotify(imagePath);
                }
            }

            m_imageFileNames = FindImageFileNames(m_folder);
            ResetInternalV();
            EditorUtility.SetDirty(this);
            if (!string.IsNullOrEmpty(folderMD5))
            {
                m_folderMD5 = folderMD5;
            }
            else
            {
                UpdateFolderMD5();
            }
        }
Esempio n. 2
0
 internal static void ResetImageLoading()
 {
     ThreadManager.Reset();
     StreamingImageSequencePlugin.ResetPlugin();
     foreach (IUpdateTask job in m_mainThreadPeriodJobs)
     {
         job.Reset();
     }
 }
        static void ImageLoader_PlayModeStateChanged(PlayModeStateChange state)
        {
            if (PlayModeStateChange.EnteredEditMode != state)
            {
                return;
            }

            InitImageLoaderInEditor();
            StreamingImageSequencePlugin.ResetImageLoadOrder();
        }
Esempio n. 4
0
//----------------------------------------------------------------------------------------------------------------------

        public override void Execute()
        {
            string imagePath    = GetImagePath();
            int    requestFrame = GetRequestFrame();

#if DEBUG_PREVIEW_IMAGE
            const int TEX_TYPE = StreamingImageSequenceConstants.IMAGE_TYPE_PREVIEW;
            StreamingImageSequencePlugin.GetImageDataInto(imagePath, TEX_TYPE, requestFrame, out ImageData imageData);
            Assert.AreNotEqual(StreamingImageSequenceConstants.READ_STATUS_LOADING, imageData.ReadStatus);
            Assert.AreNotEqual(StreamingImageSequenceConstants.READ_STATUS_SUCCESS, imageData.ReadStatus);
#endif

            StreamingImageSequencePlugin.LoadAndAllocPreviewImage(imagePath, m_width, m_height, requestFrame);
        }
//----------------------------------------------------------------------------------------------------------------------

        public override void Execute()
        {
            string imagePath    = GetImagePath();
            int    requestFrame = GetRequestFrame();

#if DEBUG_FULL_IMAGE
            const int IMAGE_TYPE = StreamingImageSequenceConstants.IMAGE_TYPE_FULL;
            StreamingImageSequencePlugin.GetImageDataInto(imagePath, IMAGE_TYPE, requestFrame, out ImageData imageData);
            Assert.AreNotEqual(StreamingImageSequenceConstants.READ_STATUS_LOADING, imageData.ReadStatus);
            Assert.AreNotEqual(StreamingImageSequenceConstants.READ_STATUS_SUCCESS, imageData.ReadStatus);
#endif

            StreamingImageSequencePlugin.LoadAndAllocFullImage(imagePath, requestFrame);
        }
//----------------------------------------------------------------------------------------------------------------------

        //Wrappers so that the code to decide the currentFrame is gathered in one place

        internal static void GetImageDataInto(string fileName, int imageType, out ImageData readResult)
        {
            StreamingImageSequencePlugin.GetImageDataInto(fileName, imageType, GetCurrentFrame(),
                                                          out readResult);
        }
 internal static void ImageLoaderOnRuntimeLoad()
 {
     StreamingImageSequencePlugin.ResetImageLoadOrder();
 }