一个 Unity 编辑器工具,用于快速生成调用 Python 脚本的 C# 扩展模板。
A Unity editor tool for quickly generating C# extension templates that call Python scripts.
-
🚀 一键生成 Python 扩展模板
-
📝 支持自定义参数列表
-
🎯 自动处理命名规范(C# PascalCase / Python snake_case)
-
💡 智能生成:有参数时自动创建参数输入面板
-
🚀 One-click Python extension template generation
-
📝 Customizable parameter list
-
🎯 Automatic naming convention handling (C# PascalCase / Python snake_case)
-
💡 Smart generation: auto-creates parameter input panel when parameters exist
-
打开菜单:
Tools > PyFunctions > 生成 Python 扩展模板 -
输入扩展名称(例如:
MyScript) -
添加参数(可选,例如:
inputPath,outputPath) -
点击"生成模板"按钮
-
Open menu:
Tools > PyFunctions > 生成 Python 扩展模板 -
Enter extension name (e.g.,
MyScript) -
Add parameters (optional, e.g.,
inputPath,outputPath) -
Click "生成模板" button
生成的文件将位于 Editor/EditorPython/[扩展名]/ 目录下:
Generated files will be located in Editor/EditorPython/[ExtensionName]/ directory:
-
[扩展名].cs- C# 调用脚本 -
[扩展名_snake_case].py- Python 脚本 -
[ExtensionName].cs- C# calling script -
[ExtensionName_snake_case].py- Python script
输入 / Input:
- 扩展名称:
ImageProcessor - 参数:
inputPath,outputPath
生成 / Generated:
-
ImageProcessor.cs- 带参数输入面板的 C# 类 -
image_processor.py- Python 脚本,自动接收参数 -
ImageProcessor.cs- C# class with parameter input panel -
image_processor.py- Python script that automatically receives parameters
-
扩展名称会自动转换为符合规范的类名
-
参数名称会自动规范化(C# camelCase / Python snake_case)
-
无参数时,点击菜单项直接执行;有参数时,会弹出参数输入面板
-
Extension names are automatically converted to valid class names
-
Parameter names are automatically normalized (C# camelCase / Python snake_case)
-
No parameters: click menu item to execute directly; With parameters: parameter input panel will pop up