以下の内容はhttps://baba-s.hatenablog.com/entry/2023/02/27/161204より取得しました。


【Unity】ArgumentException: source and destination length must be the same

概要

nativeArray.CopyFrom( array );

NativeArray.CopyFrom を使用した時に

ArgumentException: source and destination length must be the same
Unity.Collections.NativeArray`1[T].CheckCopyLengths (System.Int32 srcLength, System.Int32 dstLength) (at /Users/bokken/build/output/unity/unity/Runtime/Export/NativeArray/NativeArray.cs:541)
Unity.Collections.NativeArray`1[T].Copy (T[] src, Unity.Collections.NativeArray`1[T] dst) (at /Users/bokken/build/output/unity/unity/Runtime/Export/NativeArray/NativeArray.cs:376)
Unity.Collections.NativeArray`1[T].CopyFrom (T[] array) (at /Users/bokken/build/output/unity/unity/Runtime/Export/NativeArray/NativeArray.cs:241)

上記の例外が発生する現象に遭遇した

nativeArray と array の要素数が一致していないことが原因だった




以上の内容はhttps://baba-s.hatenablog.com/entry/2023/02/27/161204より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14