cancel
Showing results for 
Search instead for 
Did you mean: 

Allow 'unsafe' blocks in a Unity Script?

Troy_Hohaus
Champ in-the-making
Champ in-the-making

Is there anyway to allow unsafe code in a Unity Script like you could in Visual Studio? We picked up some open source DLLs and code and we are trying to implement into a Unity Script.

1 ACCEPTED ANSWER

Chris_Tucker
Star Contributor
Star Contributor

Hello,

Unsafe code cannot be used directly in a Unity Script, since we do not expose the allow unsafe code build option within the script editor. However, you can write unsafe code within Visual Studio and call it from your script as an imported assembly.

Let me know if you have any other questions!

View answer in original post

1 REPLY 1

Chris_Tucker
Star Contributor
Star Contributor

Hello,

Unsafe code cannot be used directly in a Unity Script, since we do not expose the allow unsafe code build option within the script editor. However, you can write unsafe code within Visual Studio and call it from your script as an imported assembly.

Let me know if you have any other questions!

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.