artoolkitx / arunityx

artoolkitX for Unity, providing high-performance video acquisition, marker and texture tracking and full Unity Editor support
https://www.artoolkitx.org/
Other
41 stars 22 forks source link

Bug: Unsafe code warning on importing Unity package #78

Closed SimonDarksideJ closed 1 year ago

SimonDarksideJ commented 1 year ago

The following error is reported immediately after importing the ARUnity X asset (v1.1.11)

Assets\artoolkitX-Unity\Scripts\ARXUtilityFunctions.cs(149,3): error CS0227: Unsafe code may only appear if compiling with /unsafe. Enable "Allow 'unsafe' code" in Player Settings to fix this error.

philip-lamb commented 1 year ago

Using native byte buffers requires unsafe, and we absolutely need this to support external video inside the plugin. I'm not sure if there's an easy way to set the unsafe flag on import. Are you aware of a method?

I guess the alternative is to disable use of Unity-supplied video streams unless the user explicitly requests it.

philip-lamb commented 1 year ago

Fixed by https://github.com/artoolkitx/arunityx/pull/84