2015年7月27日月曜日

[Unity] unsafeコードの動かし方


手順1.
 Visual Studioの場合、 Project > Property > Build > Allow unsafe code にチェックを入れる。

手順2.
 Assetsフォルダ直下にsmcs.rspとgmcs.rspを作成する。
   どちらも中身は -unsafe とだけ入力する。

手順3.
 UnityのEdit > Project Settings > Player を開き、
 Other Settings > Configuration > Scripting Define Symbols の欄に unsafe と入力しEnter。



Reference Sites
http://forum.unity3d.com/threads/how-do-i-enable-unsafe-code.210781/
https://github.com/Banbury/UnityPsdImporter/issues/9
http://anchan828.tumblr.com/post/32669868103/define


※補足
Scripting Define Symbols の下にある項目、Api Compatibility Level が
.NET 2.0 Subset の場合、smcs.rspだけ
.NET 2.0 の場合、 gmcs.rspだけで動きます。


0 件のコメント:

コメントを投稿