Use new ArraySegment<byte>(Array.Empty<byte>()) instead of default(ArraySegment<byte>)

`default(ArraySegment<byte>).ToArray()` throws `InvalidOperationException` since Unity 2021.
It fails `VRMTextureEnumerateTests`. Use `new ArraySegment<byte>(Array.Empty<byte>())` instead.

Confirmed to work with Unity 2020.3.34f1, 2021.3.13f1 and 2022.1.23f1.

fixes https://github.com/vrm-c/UniVRM/issues/1934
This commit is contained in:
Isamu Mogi 2022-11-30 01:46:22 +09:00
parent 84db84bc2e
commit b2b11dc6f3

View File

@ -59,7 +59,7 @@ namespace VRM
},
}
},
default
new ArraySegment<byte>(Array.Empty<byte>())
))
{
var vrm = new glTF_VRM_extensions
@ -122,7 +122,7 @@ namespace VRM
},
}
},
default
new ArraySegment<byte>(Array.Empty<byte>())
))
{
var vrm = new glTF_VRM_extensions