mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
[unity] Handle varying CopyTexture support.
This commit is contained in:
parent
6b56eb0d95
commit
b4db3b2114
@ -619,7 +619,14 @@ namespace Spine.Unity.Modules.AttachmentTools {
|
||||
}
|
||||
|
||||
static void CopyTexture (Texture2D source, Rect sourceRect, Texture2D destination) {
|
||||
Graphics.CopyTexture(source, 0, 0, (int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height, destination, 0, 0, 0, 0);
|
||||
if (SystemInfo.copyTextureSupport == UnityEngine.Rendering.CopyTextureSupport.None) {
|
||||
// GetPixels fallback for old devices.
|
||||
Color[] pixelBuffer = source.GetPixels((int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height);
|
||||
destination.SetPixels(pixelBuffer);
|
||||
destination.Apply();
|
||||
} else {
|
||||
Graphics.CopyTexture(source, 0, 0, (int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height, destination, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsRenderable (Attachment a) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user