mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
[unity] Set Mipmap Bias was not persisted on recent Unity versions. Closes #1877.
This commit is contained in:
parent
97b3f3058b
commit
6c40624d5e
@ -136,7 +136,10 @@ namespace Spine.Unity.Editor {
|
||||
if (SpineInspectorUtility.LargeCenteredButton(SpineInspectorUtility.TempContent("Set Mipmap Bias to " + SpinePreferences.DEFAULT_MIPMAPBIAS, tooltip: "This may help textures with mipmaps be less blurry when used for 2D sprites."))) {
|
||||
foreach (var m in atlasAsset.materials) {
|
||||
var texture = m.mainTexture;
|
||||
texture.mipMapBias = SpinePreferences.DEFAULT_MIPMAPBIAS;
|
||||
string texturePath = AssetDatabase.GetAssetPath(texture.GetInstanceID());
|
||||
var importer = (TextureImporter)TextureImporter.GetAtPath(texturePath);
|
||||
importer.mipMapBias = SpinePreferences.DEFAULT_MIPMAPBIAS;
|
||||
EditorUtility.SetDirty(texture);
|
||||
}
|
||||
Debug.Log("Texture mipmap bias set to " + SpinePreferences.DEFAULT_MIPMAPBIAS);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user