15-05-2023, 09:49 AM
(12-05-2023, 07:34 PM)AdamZ101 Wrote: Im using Unity 2022.2.19 HDRP, and I'm getting this error in your scripts:
Assets\Obi\Scripts\Common\Backends\Burst\DataStructures\NativeMultilevelGrid.cs(34,13): error CS0305: Using the generic type 'UnsafeList<T>' requires 1 type arguments
Assets\Obi\Scripts\Common\Backends\Burst\DataStructures\NativeMultilevelGrid.cs(88,36): error CS8377: The type 'NativeMultilevelGrid<T>.Cell<T>' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NativeList<T>'
Please advise. Thanks.
No error in Unity 2021.3.25f1 LTS URP.
Hi,
This is because the latest version of the Collections package has different requirements for generic types, there's a relatively simple workaround: Change the definition of Cell<K> in NativeMultiLevelGrid.cs to look like this:
public struct Cell<K> where K : unmanaged, IEquatable<K>
Also, change UnsafeList to UnsafeList<K>, in the same file.
let me know if you need further help,
kind regards