Raindow00S

我模仿MixAndMatchSkinsExample中的OptimizeSkin函数,试图对替换后的皮肤进行打包。在Unity中运行时,看起来一切正常,但是在build好的exe程序中,我一旦按下repack按钮触发了OptimizeSkin函数,所有图片就会变成半透明的白图。我不知道哪里出了毛病?我的函数和示例脚本中的一模一样。我尝试build示例,一切也都正常运行。
谢谢!

=====

Mimicking the OptimizeSkin function in MixAndMatchSkinsExample, I tried to package the new skin. When running in Unity, everything looked fine, but in the built exe, once I pressed the repack button to trigger the OptimizeSkin function, all the images turned into translucent white images. I don't know what went wrong. My function is exactly the same as in the sample script. I tried to build example and everything worked.

Thank you very much!

屏幕截图 2022-11-06 030726.JPG
您没有权限查看这个主题的附件。
Raindow00S
  • 帖子: 10

Misaki

详见runtime repacking一节, 内附的重要须知列出了这个问题的最常见的成因.
spine-unity 运行时文档: 组合皮肤
重要提示: 如果重打包失败或产生意外问题, 可能源于以下原因:
1.禁用了读/写. 你可能需要在并入重打包texture的源textures上设置 Read/Write Enabled 参数.
2.启用了压缩: 需要确保源texture的Texture导入设置中 Compression 为 None , 而不是 Normal Quality.
3.质量层使用了half/quarter分辨率的textures: 这个是Unity的bug, 当使用half/quarter分辨率的texture时会复制错误区域. 确保项目设置中的所有质量层都使用全分辨率texture.
4.源texture不是2次texture但Unity将其放大为了最接近次数:a)从Spine导出时启用 Pack Settings 中的 Power of two, 或者b)确保Unity的Atlas Texture导入设置中将 Non-Power of Two 置为 None.
------

See section runtime repacking where you will find an info box that lists the most common causes for this issue.
spine-unity 运行时文档: 组合皮肤
Important Note: If repacking fails or creates unexpected results, it is most likely due to any of the following causes:
1.Read/Write is disabled: Depending on platform capabilities, you may need to set the Read/Write Enabled parameter at source textures that shall be combined to a repacked texture.
2.Compression is enabled: Depending on the platform, ensure that the source texture has Texture import setting Compression set to None instead of Normal Quality.
3.Quality tier uses half/quarter resolution textures: There is a known Unity bug that copies incorrect regions when half or quarter resolution rextures are used. Ensure that all Quality tiers in Project Settings are using full resolution textures.
4.The source texture is not a power-of-two texture but Unity enlarges it to the closest power: Either a) export from Spine with Pack Settings Power of two enabled, or b) make sure the atlas Texture import settings in Unity has Non-Power of Two set to None.
头像
Misaki

Misaki
  • 帖子: 1040

Raindow00S

Misaki 写道:详见runtime repacking一节, 内附的重要须知列出了这个问题的最常见的成因.
spine-unity 运行时文档: 组合皮肤
重要提示: 如果重打包失败或产生意外问题, 可能源于以下原因:
1.禁用了读/写. 你可能需要在并入重打包texture的源textures上设置 Read/Write Enabled 参数.
2.启用了压缩: 需要确保源texture的Texture导入设置中 Compression 为 None , 而不是 Normal Quality.
3.质量层使用了half/quarter分辨率的textures: 这个是Unity的bug, 当使用half/quarter分辨率的texture时会复制错误区域. 确保项目设置中的所有质量层都使用全分辨率texture.
4.源texture不是2次texture但Unity将其放大为了最接近次数:a)从Spine导出时启用 Pack Settings 中的 Power of two, 或者b)确保Unity的Atlas Texture导入设置中将 Non-Power of Two 置为 None.
------

See section runtime repacking where you will find an info box that lists the most common causes for this issue.
spine-unity 运行时文档: 组合皮肤
Important Note: If repacking fails or creates unexpected results, it is most likely due to any of the following causes:
1.Read/Write is disabled: Depending on platform capabilities, you may need to set the Read/Write Enabled parameter at source textures that shall be combined to a repacked texture.
2.Compression is enabled: Depending on the platform, ensure that the source texture has Texture import setting Compression set to None instead of Normal Quality.
3.Quality tier uses half/quarter resolution textures: There is a known Unity bug that copies incorrect regions when half or quarter resolution rextures are used. Ensure that all Quality tiers in Project Settings are using full resolution textures.
4.The source texture is not a power-of-two texture but Unity enlarges it to the closest power: Either a) export from Spine with Pack Settings Power of two enabled, or b) make sure the atlas Texture import settings in Unity has Non-Power of Two set to None.
Thanks!! The first one is the issue I met. Thank you very much!
Raindow00S
  • 帖子: 10

Misaki

I’m glad to hear you’ve figured it out. Thank you for getting back to us!
头像
Misaki

Misaki
  • 帖子: 1040


回到 中国Spine用户