UnityPython is a Python implementation that enables all-platform UI/game development and development time hot-reloading.
This extension is enabled when a .unitypython.json is included anywhere in a workspace folder.
Multi-root workspaces are supported, in case you need to edit Unity C# and UnityPython simultaneously.
Features:
- Report if
unitypythonis not installed in the selected Python environment (by Microsoft Python Extension). - Compile Python scripts to
${unitypython.build-output-directory}(default:Compiled) directory on save. Python executable in the selected environment is used. - Excellent Pylance Support: the bundled stub files
unitypython-typeshedare copied to${unitypython.build-output-directory}(default:unitypython-typeshed) directory.
- Activate your preferred Python environment (Python >= 3.8 is a must, Python 3.10 is better), and do
pip install upycc --upgrade - Install
vscode-unitypythonextension, and create a.unitypython.jsonin your workspace. - (for Unity users who wants to hot reload UnityPython) Copy
Assets/FileWatcher.csandAssets/PythonHotReloader.csto your Unity project'sAssetsfolder, and attach these two components to a top-level empty game object.
NOTE: The release is still preview, please update this extension frequently.