Преглед на файлове

[unity] Unity SpriteAtlas support: Upon build to platform, the internally generated sprite atlas texture is used instead of the png file generated for the editor (to reduce additional memory usage). This completes Unity SpriteAtlas support, together with previous commit d35550d. Closes #940.

Harald Csaszar преди 5 години
родител
ревизия
d499dba7c4
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SpineSpriteAtlasAsset.cs

+ 3 - 0
spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SpineSpriteAtlasAsset.cs

@@ -190,6 +190,9 @@ namespace Spine.Unity {
 				texture = AccessPackedTexture(sprites);
 				texture = AccessPackedTexture(sprites);
 
 
 			Material material = materials[0];
 			Material material = materials[0];
+		#if !UNITY_EDITOR
+			material.mainTexture = texture;
+		#endif
 
 
 			Spine.AtlasPage page = new AtlasPage();
 			Spine.AtlasPage page = new AtlasPage();
 			page.name = spriteAtlas.name;
 			page.name = spriteAtlas.name;