Unity runtime Python script plugin with pythonnet. Write your game script with Python in Unity.
Currently it is possible to use under the windows and macos.
You can just copy Scripts and Python directory into your project. Run PythonModule.Initialize()
to init python.
- support script reload in editor. If you know Unity's package PythonScript you know that if you want to update a script that has been imported, you need to restart Unity Editor, which makes the development process very cumbersome.
- support macos
- c# code hints: Unity menu Tools/GeneratorAPI
- python debug support
- research build for android & ios
- support import python file by unity resource load method, such as Resource, BundleResource, AddressableAsset, if necessary
- Editor config support for python env set and site-packages set
Here I use ptvsd to support python debugging. You can set config file like this if you use vscode.
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Remote Attach",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "127.0.0.1",
"port": 12345
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}/Python/Windows",
"remoteRoot": "../../"
}
]
}
]
}