Hello, how i can write assembly parts in Unity3D?
I have try
_asm
{
// asm code here
}
But it don’t work.
Hello, how i can write assembly parts in Unity3D?
I have try
_asm
{
// asm code here
}
But it don’t work.
No, i dont think so.
But, you can do it in a plugin if you have PRO.
Oki, i found it!
You can write asm code in C/C++ and then export DLL and load it in C#MonoDevelop
C Code
#include "stdafx.h"
extern "C" __declspec(dllexport)
int _asmAdd(int x, int y)
{
int sum;
_asm
{
mov eax, x;
mov ebx, y;
add eax, ebx;
mov sum, eax;
}
return sum;
}
Compile C Code, take DLL and import it on your project
// Dll Path
[DllImport("C:/ASMParts.dll")]
private extern static int _asmAdd(int x, int y);
void OnGUI()
{
GUI.Label(new Rect(100, 50, 100, 100), _asmAdd(10, 20).ToString());
}