|
I have an MFC dll file and source project. I wonder can i use it as an unity plugin file? Then how can I use it? Need help.
(comments are locked)
|
|
In principle, you can use any DLL file as a plugin in Unity - this is a .NET feature, and is accessible via C# scripts.
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class MyDll : MonoBehaviour {
[DllImport("MyDllFile")]
public static extern int Function1(int v1);
[DllImport("MyDllFile")]
public static extern float Function2(float v2);
}
This script imports the functions Function1 and Function2 from the DLL file "MyDllFile.dll" stored in the Plugins folder. Can I use Standard MFC API function such as LoadLibrary?
Dec 03 '11 at 12:58 AM
RKS324
I had some experience using specific plugins that I wrote in Delphi's Pascal, but honestly know nothing about MFC functions. If LoadLibrary will link to a second DLL, you may have problems - see this question: http://answers.unity3d.com/questions/187694/dllnotfound-when-the-plugin-c-dll-links-another-c.html
Dec 03 '11 at 10:40 AM
aldonaletto
(comments are locked)
|
