Fish

This is my PmaTexturePreset file.
Screen Shot 2021-12-16 at 17.34.44.png

When I drag three spine files into unity, the texture type of image is always "Default".
Screen Shot 2021-12-16 at 17.36.35.png

I want it to be "Sprite (2D and UI), like the example I downloaded from official website:
Screen Shot 2021-12-16 at 17.37.42.png


How can I do to change this behavior? And why it is different in my Unity?

Thanks.
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
Fish
  • Mesajlar: 14

Harald

Sorry for the confusion, TextureType of the example skeletons seem to have been a mix of Default and Sprite (2D and UI). We have just pushed a commit which unifies TextureType at all example skeletons to Default. It will be published with the next unitypackage release.

Using Sprite (2D and UI) only yields a benefit when a SpriteRenderer is used, with MeshRenderer it could theoretically even lead to drawbacks (when the textures are combined to an even larger sprite atlas, but still different Materials are used for each skeleton). So we would recommend using TextureType Default.
Fish yazdı:This is my PmaTexturePreset file.
..
How can I do to change this behavior? And why it is different in my Unity?
Your PmaTexturePreset file shows TextureType as Default, so if you don't want it to be like that, you need to change the preset values. Alternatively you could create a separate preset file and assign it as default texture settings in the Spine Preferences.
Kullanıcı avatarı
Harald

Harri
  • Mesajlar: 4002

Fish

Thanks for your reply!
I want to use "Mix and Match Equip" demo in Canvas (SkeletonGraphic UnityUI). Everything goes well when TextureType is Sprite (2D and UI).
But for Default, when I call runtimeSkin.GetRepackedSkin, it shows error Graphics.CopyTexture called with region not fitting in source elemen:
Screen Shot 2021-12-17 at 10.40.07.png

If I don't call runtimeSkin.GetRepackedSkin, the attachment I changed appears very strange.

How can I achieve this function in Canvas (SkeletonGraphic UnityUI)? Do I have to change TextureType to Sprite (2D and UI)`?

---

Ok, I found the reason from official document:
The source texture is not a power-of-two texture but Unity enlarges it to the closest power

I will try again later.
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
Fish
  • Mesajlar: 14

Harald

Glad you've figured it out, thanks for getting back to us.

In general you might always want to avoid Unity's Texture settings Power of two other than none that change the texture size (both up and down). It is better to export the atlas texture from the Spine Editor with setting Power of two enabled instead.
Kullanıcı avatarı
Harald

Harri
  • Mesajlar: 4002


Dön 中国Spine用户