Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Obsolete function warnings in Unity 2021.3.2f1 with Obi 6.4
#1
Hello,

Using
  • Unity 2021.3.2f1
  • Obi 6.4
  • Burst 1.6.5
  • Collections 1.2.3
  • Mathematics 1.2.6
  • Jobs 0.50.0-preview.9
We are getting these compile warnings:
Code:
Assets\Obi\Scripts\Common\Backends\Burst\DataStructures\NativeMultilevelGrid.cs(34,13): warning CS0618: 'UnsafeList' is obsolete: 'Untyped UnsafeList is deprecated, please use UnsafeList<T> instead. (RemovedAfter 2021-05-18)'

Assets\Obi\Scripts\Common\Backends\Burst\DataStructures\NativeMultilevelGrid.cs(39,32): warning CS0618: 'UnsafeList' is obsolete: 'Untyped UnsafeList is deprecated, please use UnsafeList<T> instead. (RemovedAfter 2021-05-18)'

Assets\Obi\Scripts\Common\Backends\Burst\Solver\BurstSolverImpl.cs(314,13): warning CS0618: 'NativeList<int>.CopyFrom(int[])' is obsolete: 'Please use `CopyFromNBC` from `Unity.Collections.NotBurstCompatible` namespace instead. (RemovedAfter 2021-06-22)'

The game still runs and can build a player but we want it to clear those warnings. For the last one, the suggestion is to replace with a function from the "Not Burst Compatible" API which doesn't seem to be the proper way to fix it.

Are these known issues?
How can we fix these?

Cheers
Reply
#2
Hi there!

Yes, these are known issues. However they're just warnings about Unity deprecating certain APIs, the engine should work fine regardless. Obi 7 (which I'm working on) will only be compatible with Unity 2021.3.0 and up, and will cease to use older APIs from previous Unity versions.

You can try replacing NativeMultilevelGrid.cs with the one I'm attaching, which makes use of the generic version of UnsafeList. This should get rid of the warnings.

kind regards,


Attached Files
.cs   NativeMultilevelGrid.cs (Size: 8.78 KB / Downloads: 17)
Reply