Unity Gaming Services CLI
Manage trigger configurations from the command line using the Unity Gaming Services command-line interface.
読み終わるまでの所要時間 1 分最終更新 23日前
Unity Gaming Services CLI を使用して、トリガーを操作できます。CLI により、コマンドラインからトリガー設定を管理できます。
前提条件
CLI の詳細情報については、Unity Gaming Services CLI の使用の準備ガイド のステップに従います。 このガイドに従うには、最初に以下のアクションを実行する必要があります。- UGS CLI をインストール します。
-
プロジェクト ID と環境を以下のように設定します。
ugs config set project-id <your-project-id>
ugs config set environment-name <your-environment-name> - Triggers と 環境管理 に必要なロールでサービスアカウントを設定します。認証の取得 を参照してください。
CLI の使用
すべてのコマンドとオプションの完全なリファレンスについては、Triggers コマンドラインのドキュメント を参照してください。トリガーのデプロイ
new-file設定ファイルのコンテンツは以下のようになります。ugs 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" } ]}
Deployugs deploy <path-to-triggers-file> <path-to-triggers-file>
トリガーを既存の Cloud Code スクリプトまたはモジュールに関連付けている場合、ugs deploy <path-to-directory>
eventTypeトリガーの取得
Fetchugs fetch <path>
トリガーの削除
トリガーを削除するには、--reconciledeployugs deploy --services triggers <path-to-triggers-file> --reconcile