mirror of
https://github.com/maxartz15/MA_TextureAtlasser.git
synced 2026-09-17 04:05:45 +02:00
Merge pull request #14 from yany79/guard-texture-reinitialize-for-older-unity
Use Texture2D.Reinitialize on Unity 2021.2 and newer.
This commit is contained in:
@@ -122,7 +122,11 @@ namespace MA_Texture
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_2021_2_OR_NEWER
|
||||||
|
texture.Reinitialize(newWidth, newHeight);
|
||||||
|
#else
|
||||||
texture.Resize(newWidth, newHeight);
|
texture.Resize(newWidth, newHeight);
|
||||||
|
#endif
|
||||||
texture.SetPixels(newColors);
|
texture.SetPixels(newColors);
|
||||||
texture.Apply();
|
texture.Apply();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user