Unity Gaming Services CLI
Manage trigger configurations from the command line using the Unity Gaming Services command-line interface.
읽는 시간 1분최근 업데이트: 4달 전
Unity Gaming Services CLI를 사용하여 트리거와 상호 작용할 수 있습니다. CLI를 사용하면 커맨드 라인에서 트리거 구성을 관리할 수 있습니다.
필수 조건
CLI에 대한 보다 포괄적인 내용을 알아보려면 Unity Gaming Services CLI 시작하기 가이드에 나와 있는 단계를 따르십시오.
이 가이드를 따르려면 먼저 다음 작업을 완료해야 합니다.
-
다음과 같이 프로젝트 ID와 환경을 구성합니다.
ugs config set project-id <your-project-id>
ugs config set environment-name <your-environment-name>
CLI 사용
모든 커맨드와 옵션에 대한 전체 레퍼런스가 필요한 경우, Triggers 커맨드 라인 기술 자료를 참고하십시오.
트리거 배포
new-fileugs triggers new-file <file-name>
구성 파일 콘텐츠의 예시는 다음과 같습니다.
{ "$schema": "https://ugs-config-schemas.unity3d.com/v1/triggers.schema.json", "Configs": [ { "Name": "example-trigger", "EventType": "com.unity.services.scheduler.{{EVENT_NAME}}.v{{EVENT_VERSION}}", "ActionUrn": "urn:ugs:cloud-code:MyScript", "ActionType": "cloud-code" } ]}
여러 트리거를 포함하도록 구성 파일을 수정할 수도 있습니다.
{ "$schema": "https://ugs-config-schemas.unity3d.com/v1/triggers.schema.json", "Configs": [ { "Name": "example-trigger", "EventType": "com.unity.services.scheduler.{{EVENT_NAME}}.v{{EVENT_VERSION}}", "ActionUrn": "urn:ugs:cloud-code:MyScript", "ActionType": "cloud-code" }, { "Name": "example-trigger-2", "EventType": "com.unity.services.scheduler.{{EVENT_NAME}}.v{{EVENT_VERSION}}", "ActionUrn": "urn:ugs:cloud-code:MyScript", "ActionType": "cloud-code" } ]}
Deploy트리거가 활성화될 수 있도록 구성 파일을 배포해야 합니다.
ugs deploy <path-to-triggers-file> <path-to-triggers-file>
ugs deploy <path-to-directory>
트리거를 기존 Cloud Code 스크립트나 모듈과 연결한 경우, 지정된 으로 이벤트를 발생시키면 트리거가 발동하여 연결된 Cloud Code 스크립트 또는 모듈이 실행됩니다.
eventType트리거 검색
Fetch제공되는 경로는 트리거가 저장되는 디렉토리입니다.
ugs fetch <path>
트리거 삭제
트리거를 삭제하려면 플래그를 포함해 커맨드를 실행합니다.
deploy--reconcileugs deploy --services triggers <path-to-triggers-file> --reconcile