文档

​
​

Development

User Acquisition

Monetization

工业

Unity Cloud

Get Started

Asset Manager SDKs and services

Open Unity Dashboard

Unity Cloud

此页面不支持所选语言。
​
​
Unity Dashboard
  • Accounts
  • Organizations
  • Projects
  • Products
  • Billing
Developer Data
  • Introduction to the Developer Data Framework
  • Get started
  • View Diagnostics for your project
  • Privacy and consent
Unity Asset Manager
  • What's new
  • Asset Manager web
  • Asset Store
  • Manage Assets in the Editor
  • Unity Version Control
  • Developer documentation
Unity Pipeline Automation
  • About
  • Get started
  • Pipelines
    • Create a pipeline
    • Run a pipeline
    • Edit a pipeline
    • Delete a pipeline
    • Pipeline parameters
    • Steps
    • Custom Scripts
      • Use Custom Scripts
      • System parameters
      • Reference parameters
      • Coding patterns
  • Automations
  • Monitor jobs
  1. Unity Cloud Documentation
  2. Unity Pipeline Automation (beta)
  3. Custom Scripts (beta)

Use Custom Scripts

Use Custom Scripts to further extend and customize your pipeline by running your own code.
阅读时间2 分钟
最后更新于 8 个月前

重要
You're solely responsible for any custom code you enter, and Unity is not liable for any errors, malfunctions, or damages resulting from the use of your custom code.
You can provide code tailored to your needs. The following apps support Custom Scripts:
  • Asset Transformer
  • Linux Shell
  • Python
  • Blender
You can use Custom Scripts in two ways:
  • Enter custom code in the built-in editor, and execute it with command-line arguments (optional).
  • Fetch a script from a script library and execute it with command-line arguments (optional).

Prerequisites

You can access Custom Scripts when you create or edit a pipeline.

Enter custom script code

To enter your custom code:
  1. Sign in to your Unity Dashboard account.
  2. In the side navigation bar, select Pipeline Automation > Pipelines. You can create or edit a pipeline.
  3. In the pipeline builder, add a step. The Select an action from app dialog opens.
  4. Select the Python app.
  5. Select the Run Custom Script action.
  6. Select Add Action. In the Step Parameters tab, the Custom Scripts section appears in the Inputs section.
  7. Enter your code in the built-in editor or select Browse Files to upload a script file from your local drive. The script code from your file appears in the built-in editor.
  8. Enter Command Line Arguments to pass as pipeline inputs.
  9. Select Save.
Your custom script is now embedded in the pipeline. When you run the pipeline, it runs your script file and prompts for input if you enable Command Line Arguments.

Fetch and run a custom script

To run a script in this way, ensure the script exists in the job’s storage. First download it from a source such as Unity Asset Manager or Unity Version Control. The output of an action that downloads files includes parameters that locate the downloaded script path. You must provide this path to actions that run script files.
To fetch and run a custom script file:
  1. Sign in to your Unity Dashboard account.
  2. In the side navigation bar, select Pipeline Automation > Pipelines. You can create or edit a pipeline.
  3. In the pipeline builder, add a step. The Select an action from app dialog opens.
  4. Select the Python app.
  5. Select the Run Custom Script File action.
  6. Select Add Action. In the Step Parameters tab, the Custom Scripts section appears in the Inputs section.
  7. In the Script Path field, select Download file – Download Directory and enter the script file name, for example,
    /scriptexample.py
    .
  8. Enter Command Line Arguments to allow the script to receive parameters generated by the pipeline.
  9. Select Save.
Your custom script is now embedded in the pipeline. When you run the pipeline, it runs your script file and prompts for input if you enable Command Line Arguments.

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。

  • 在本页上
    • Prerequisites

    • Enter custom script code

    • Fetch and run a custom script


报告此页面的问题