How to use unsafe context in Unity
<p>I want to use <code>c++ code</code> in <code>c#</code> for Unity using CLR.</p>
<blockquote>
<p>The program works properly outside of unity, but inside of engine it gives me an error:<br />
<em>&quot;cs0227: unsafe code requires the 'unsafe' command line option to be specified&quot;</em></p>
</blockquote>
<p>I am really confused, because the project builds successfully in visual studio (without any errors or warnings). I have &quot;<strong>allow</strong> <strong>unsafe</strong>&quot; button activated.</p>
<pre class="lang-csharp prettyprint-override"><code>using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class newspawn_real : MonoBehaviour {
    void Start () {
        unsafe
        {
            fixed (int * p = &amp;bam[0, 0, 0])
            {
                CppWrapper.CppWrapperClass controlCpp = new CppWrapper.CppWrapperClass();
                controlCpp.allocate_both();
                controlCpp.fill_both();
                controlCpp.fill_wrapper();
            }
        }
    }
    // ...
}
</code></pre>