Пример #1
0
        public void WriteCacheToDisk()
        {
#if UNITY_EDITOR
            int length = m_cacheEntries.Length;
            for (int i = 0; i < length; i++)
            {
                ImageProcessing.WriteRenderTexture(m_cacheEntries[i].fullPath, m_cacheEntries[i].texture);

                //Refresh mask immediately by reimporting it in the same step
                AssetDatabase.ImportAsset(m_cacheEntries[i].assetPath, ImportAssetOptions.ForceUpdate);

                m_cacheEntries[i].texture = null;
            }

            //clear the cache for a clean start, this will free the cache from outdated entries, etc.
            //the cache will be rebuilt quickly only with the relevant files which are saved to disk now.
            m_cacheEntries = new BakedMaskCacheEntry[0];
#endif
        }
Пример #2
0
 private static void RenderToPng(string path)
 {
     RenderToTemporary();
     ImageProcessing.WriteRenderTexture(path, m_tmpRenderTexture, GaiaConstants.ImageFileType.Png, TextureFormat.RGBA32);
     CleanUpRenderTexture();
 }