2using ICSharpCode.SharpZipLib.Zip;
13 public override TextureLoadingContext
Map(AssetLoaderContext assetLoaderContext, ITexture texture)
16 if (zipLoadCustomContextData ==
null)
18 throw new Exception(
"Missing custom context data.");
20 var zipFile = zipLoadCustomContextData.ZipFile;
23 throw new Exception(
"Zip file instance is null.");
25 if (
string.IsNullOrWhiteSpace(texture.Filename))
27 if (assetLoaderContext.Options.ShowLoadingWarnings)
29 UnityEngine.Debug.LogWarning(
"Texture name is null.");
33 var shortFileName = FileUtils.GetShortFilename(texture.Filename).ToLowerInvariant();
34 foreach (ZipEntry zipEntry
in zipFile)
40 var checkingFileShortName = FileUtils.GetShortFilename(zipEntry.Name).ToLowerInvariant();
41 if (shortFileName == checkingFileShortName)
44 var textureLoadingContext =
new TextureLoadingContext
46 Context = assetLoaderContext,
47 Stream = AssetLoaderZip.ZipFileEntryToStream(out _, zipEntry, zipFile),
50 return textureLoadingContext;
Represents a mapper class class used to load Textures from Zip files.
override TextureLoadingContext Map(AssetLoaderContext assetLoaderContext, ITexture texture)
Represents a class passed as the custom data to the Asset Loader Context when loading Models from Zip...