Skip to content
/ UniPy Public

unity runtime python script plugin with python.net

License

Notifications You must be signed in to change notification settings

leo6033/UniPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

UniPy

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.

How To Use

You can just copy Scripts and Python directory into your project. Run PythonModule.Initialize() to init python.

TODOList:

  • 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

debug setting

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": "../../"
                }
            ]
        }
    ]
}

About

unity runtime python script plugin with python.net

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published