유니티 에서 제공하는 DLL 활용 방법 설명 페이지
- https://docs.unity3d.com/Manual/Plugins.html
Unity - Manual: Plug-ins
Assembly Definition File Format Import and configure plug-ins Plug-ins In Unity, you normally use scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in
docs.unity3d.com
C++ 로 제작된 DLL 류들은 "native plug-ins" 라는 용어로 표현.
C# 클래스 라이브러리 형식으로 제작된 DLL 류들은 "managed plug-ins"라는 용어로 표현.
유니티에서 native plug-ins 활용 방법 설명 페이지
https://docs.unity3d.com/Manual/NativePlugins.html
Unity - Manual: Native plug-ins
Building plug-ins for desktop platforms Native plug-ins Unity supports native plug-insA set of code created outside of Unity that creates functionality in Unity. There are two kinds of plug-ins you can use in Unity: Managed plug-ins (managed .NET assemblie
docs.unity3d.com
유니티에서 아래 C# 스트립트 코드 이용해야 함이 핵심. 유니티의 특수성은 아니며 C# 에서 C++ DLL 활용위한 C# 의 문법 체계.
using UnityEngine;
using System.Runtime.InteropServices;
class ExampleScript : MonoBehaviour {
#if UNITY_IPHONE
// On iOS plugins are statically linked into
// the executable, so we have to use __Internal as the
// library name.
[DllImport ("__Internal")]
#else
// Other platforms load plugins dynamically, so pass the
// name of the plugin's dynamic library.
[DllImport ("PluginName")]
#endif
private static extern float ExamplePluginFunction ();
void Awake () {
// Calls the ExamplePluginFunction inside the plugin
// And prints 5 to the console
print (ExamplePluginFunction ());
}
}
첫 등록 : 2024.07.10
최종 수정 :
단축 주소 : https://igotit.tistory.com/5726
'VisualStudio.C++.C# > 코딩팁,함수활용,단편' 카테고리의 다른 글
MFC . CView . CDC TextOutW 문자열 출력. (3) | 2023.12.03 |
---|---|
CEvent . Lock() . SetEvent() . ResetEvent() (0) | 2022.04.09 |
MFC. CTreeCtrl. Tree Control . 트리 컨트롤 사용법. (0) | 2022.04.04 |
MFC. menu, context menu (0) | 2022.04.04 |
win api. Cryptography API : Next Generation. 암호화. 복호화. (0) | 2022.04.04 |
댓글