- Home /
pointer in unity
i am using unsafe in monoDevelop i compile my programme without probleme but i find the probleme in unity 3d :
using UnityEngine; using System.Collections; using System.Runtime.InteropServices; // DllImport
unsafe public class Myscript : MonoBehaviour {
public string ip;
public string pas;
public void* VC;
[DllImport("systemeAPI")]
unsafe public static extern void* Opensysteme( string ip);
// Use this for initialization
void Start () {
Opensysteme("10.0.1.12");
}
}
Assets/Myscript.cs(5,21): error CS0227: Unsafe code requires the `unsafe' command line option to be specified
thk you
@virtuose120 , seriously, tag your questions correctly!
From a quick search, it seems you need Unity Pro for unsafe code. And set compiler options.
Format your code properly if you want people to help you.
Your answer

Follow this Question
Related Questions
Is it impossible to use the code with keyword "unsafe" in C#? 2 Answers
Is 'unsafe' and 'fixed' keywords supported on mobile platforms? 0 Answers
Unsafe code with Unity 1 Answer
Using 3rd party Dll and C# file that has 'unsafe' code 0 Answers
Error: "Pointers and fixed size buffers may only be used in an unsafe context." 1 Answer