mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
Alternate Atlas constructor.
This commit is contained in:
parent
3797b7b7b0
commit
0c5e3b4400
@ -78,6 +78,12 @@ namespace Spine {
|
|||||||
Load(reader, dir, textureLoader);
|
Load(reader, dir, textureLoader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Atlas (List<AtlasPage> pages, List<AtlasRegion> regions) {
|
||||||
|
this.pages = pages;
|
||||||
|
this.regions = regions;
|
||||||
|
this.textureLoader = null;
|
||||||
|
}
|
||||||
|
|
||||||
private void Load (TextReader reader, String imagesDir, TextureLoader textureLoader) {
|
private void Load (TextReader reader, String imagesDir, TextureLoader textureLoader) {
|
||||||
if (textureLoader == null) throw new ArgumentNullException("textureLoader cannot be null.");
|
if (textureLoader == null) throw new ArgumentNullException("textureLoader cannot be null.");
|
||||||
this.textureLoader = textureLoader;
|
this.textureLoader = textureLoader;
|
||||||
@ -204,6 +210,7 @@ namespace Spine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose () {
|
public void Dispose () {
|
||||||
|
if (textureLoader == null) return;
|
||||||
for (int i = 0, n = pages.Count; i < n; i++)
|
for (int i = 0, n = pages.Count; i < n; i++)
|
||||||
textureLoader.Unload(pages[i].rendererObject);
|
textureLoader.Unload(pages[i].rendererObject);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user