기술 자료

Unity Version Control

Trigger edit command reference

Find the options and arguments you can use to edit triggers from the Unity Version Control command line.
읽는 시간 2분최근 업데이트: 8일 전

The
cm trigger edit
command edits a trigger on a server.

Usage

cm trigger | tr edit <subtype-type> <position_number> [--position=<new_position>] [--name=<new_name>] [--script=<script_path>] [--filter=<str_filter>] [--server=<repserverspec>]
cm tr
is an alias of
cm trigger
.

Options and arguments

The
cm trigger edit
command accepts the following options and arguments:

Option or argument

Required

Description

subtype-type
YesTrigger execution and trigger operation. To see a list of trigger types, run
cm trigger showtypes
.
position_number
YesPosition of the trigger to edit.
--position
NoNew position of the specified trigger. This position must not be in use by another trigger of the same type.
--name
NoNew name of the specified trigger.
--script
NoNew execution path of the specified trigger script. If the script starts with
webtrigger
, Unity Version Control treats the trigger as a web trigger. For more information, refer to Remarks.
--filter
NoChecks only items that match the specified filter.
--server
NoModifies the trigger on the specified server. If you don't specify a server, the command runs on the server that the client is configured to use. To learn more about server specifications, run
cm help objectspec
.

Remarks

To make a trigger a web trigger, set
--script
to
webtrigger <target-uri>
. The trigger then sends a POST request to the URI. The request body contains a JSON object with the trigger environment variables and an
INPUT
key that holds an array of strings.

Example commands to edit triggers

Change the name and script of the trigger of type
after-setselector
at position 6:
cm trigger edit after-setselector 6 --name="Backup2 manager" --script="/new/path/to/script"
Move the trigger of type
before-mklabel
from position 7 to position 4 on the server
myserver:8084
:
cm tr edit before-mklabel 7 --position=4 --server=myserver:8084
Change the script of the trigger of type
after-add
at position 2 to a web trigger:
cm trigger edit after-add 2 --script="webtrigger http://myserver.org/api"

Additional resources