void UpdateAtlasIfNeeded()
        {
            var setting        = target;
            var recentImported = LevelTexturePreprocessor.PullRecentlyImportedTextures();

            var updateNeeded = false;

            foreach (var newTex in recentImported)
            {
                if (!setting.Contains(newTex))
                {
                    continue;
                }

                var newTexHash = LevelTexturePreprocessor.GetHash(newTex);
                if (setting.UsedTexturePixelHashes.Contains(newTexHash))
                {
                    continue;
                }

                updateNeeded = true;
                break;
            }

            if (updateNeeded)
            {
                GenerateAtlas();
            }
        }
Example #2
0
 static void GetTextureHashes(IEnumerable <TextureCollection> collections, ICollection <string> result)
 {
     foreach (var collection in collections)
     {
         foreach (var dat in collection)
         {
             var tex  = dat.GetTexture();
             var hash = LevelTexturePreprocessor.GetHash(tex);
             result.Add(hash);
         }
     }
 }