Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Entities Package Compatability
#1
I am getting a few errors when trying to use Obi in a project with Entities.


Quote: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>'

Assets\Obi\Scripts\Common\Backends\Burst\Solver\DequeueIntoArrayJob.cs(12,31): error CS8377: The type '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 'NativeQueue<T>'

My guess is that it's the experimental Collections package (2.1.0-pre.2) causing it.

How can I fix this?
Reply
#2
(18-03-2023, 05:37 AM)SuikaSukiyo Wrote: I am getting a few errors when trying to use Obi in a project with Entities.



My guess is that it's the experimental Collections package (2.1.0-pre.2) causing it.

How can I fix this?

Hi!

Yes, we’re aware that the latest version of the Collections package breaks backwards compatibility. This thread describes the solution:
http://obi.virtualmethodstudio.com/forum...UnsafeList

Let me know if I can be of further help,

Kind regards
Reply
#3
SuikaSukiyo Wrote:I use a VPN and the forum banned me from replying.

I manually whitelisted your account in the anti spam filters, you should be able to post again. Let me know if you encounter anymore issues.

Quote:Assets\Obi\Scripts\Common\Backends\Burst\DataStructures\ConstraintBatcher\ConstraintSorter.cs(144,27): error CS8377: The type '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 'NativeSortExtension.Sort<T, U>(NativeSlice<T>, U)'

Change the declaration of the ConstraintSorter class so that the generic constraint on type T is "unmanaged" instead of "struct", as the error message suggests. Like this:

Quote:public class ConstraintSorter<T> where T : unmanaged, IConstraint

Quote:Assets\Obi\Scripts\Common\Backends\Burst\Solver\BurstSolverImpl.cs(320,37): error CS1503: Argument 1: cannot convert from 'int[]' to 'in Unity.Collections.NativeArray<int>

Use CopyFromNBC from the Unity.Collections.NotBurstCompatible namespace, instead of CopyFrom (since CopyFrom has been removed in the latest Collections package version):
https://docs.unity3d.com/Packages/com.un...sions.html

That should solve the problem, let me know if I can be of further help.

kind regards,
Reply
#4
Thank you that worked perfectly; no more errors.
Reply