Unity Gaming Services CLI
Manage trigger configurations from the command line using the Unity Gaming Services command-line interface.
読み終わるまでの所要時間 1 分最終更新 3ヶ月前
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>
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>
トリガーの削除
トリガーを削除するには、 フラグを指定して コマンドを実行します。
--reconciledeployugs deploy --services triggers <path-to-triggers-file> --reconcile