nccgs 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/nccgs-accessibility-specialist.md +26 -0
- package/.claude/agents/nccgs-adversarial-reviewer.md +26 -0
- package/.claude/agents/nccgs-ai-programmer.md +26 -0
- package/.claude/agents/nccgs-analytics-engineer.md +26 -0
- package/.claude/agents/nccgs-art-direction-lead.md +26 -0
- package/.claude/agents/nccgs-audio-direction-lead.md +26 -0
- package/.claude/agents/nccgs-creative-director.md +26 -0
- package/.claude/agents/nccgs-documentation-manager.md +26 -0
- package/.claude/agents/nccgs-economy-designer.md +26 -0
- package/.claude/agents/nccgs-engine-programmer.md +26 -0
- package/.claude/agents/nccgs-game-design-lead.md +26 -0
- package/.claude/agents/nccgs-game-designer.md +26 -0
- package/.claude/agents/nccgs-gameplay-programmer.md +26 -0
- package/.claude/agents/nccgs-level-designer.md +26 -0
- package/.claude/agents/nccgs-live-ops-designer.md +26 -0
- package/.claude/agents/nccgs-localization-lead.md +26 -0
- package/.claude/agents/nccgs-narrative-lead.md +26 -0
- package/.claude/agents/nccgs-network-programmer.md +26 -0
- package/.claude/agents/nccgs-performance-analyst.md +26 -0
- package/.claude/agents/nccgs-producer.md +26 -0
- package/.claude/agents/nccgs-production-coordinator.md +23 -0
- package/.claude/agents/nccgs-programming-lead.md +26 -0
- package/.claude/agents/nccgs-prototyper.md +26 -0
- package/.claude/agents/nccgs-qa-engineer.md +26 -0
- package/.claude/agents/nccgs-qa-lead.md +26 -0
- package/.claude/agents/nccgs-release-engineer.md +26 -0
- package/.claude/agents/nccgs-release-lead.md +26 -0
- package/.claude/agents/nccgs-security-engineer.md +26 -0
- package/.claude/agents/nccgs-sound-designer.md +26 -0
- package/.claude/agents/nccgs-systems-designer.md +26 -0
- package/.claude/agents/nccgs-technical-architect.md +26 -0
- package/.claude/agents/nccgs-technical-artist.md +26 -0
- package/.claude/agents/nccgs-technical-director.md +26 -0
- package/.claude/agents/nccgs-tools-programmer.md +26 -0
- package/.claude/agents/nccgs-ui-programmer.md +26 -0
- package/.claude/agents/nccgs-unity-build-specialist.md +26 -0
- package/.claude/agents/nccgs-unity-content-specialist.md +26 -0
- package/.claude/agents/nccgs-unity-implementer.md +26 -0
- package/.claude/agents/nccgs-unity-rendering-specialist.md +26 -0
- package/.claude/agents/nccgs-unity-systems-specialist.md +26 -0
- package/.claude/agents/nccgs-unity-ui-specialist.md +26 -0
- package/.claude/agents/nccgs-ux-designer.md +26 -0
- package/.claude/agents/nccgs-verification-engineer.md +26 -0
- package/.claude/agents/nccgs-world-builder.md +26 -0
- package/.claude/agents/nccgs-writer.md +26 -0
- package/.claude/nccgs/THIRD_PARTY_NOTICES.md +13 -0
- package/.claude/nccgs/VERSION +1 -0
- package/.claude/nccgs/constitution.md +131 -0
- package/.claude/nccgs/hooks/agent-audit.mjs +10 -0
- package/.claude/nccgs/hooks/common.mjs +41 -0
- package/.claude/nccgs/hooks/post-compact.mjs +1 -0
- package/.claude/nccgs/hooks/pre-compact.mjs +8 -0
- package/.claude/nccgs/hooks/protect-git.mjs +22 -0
- package/.claude/nccgs/hooks/protect-write.mjs +17 -0
- package/.claude/nccgs/hooks/session-start.mjs +15 -0
- package/.claude/nccgs/hooks/session-stop.mjs +7 -0
- package/.claude/nccgs/protocols/agent-contract.md +34 -0
- package/.claude/nccgs/protocols/context-packets.md +13 -0
- package/.claude/nccgs/protocols/evidence.md +15 -0
- package/.claude/nccgs/protocols/model-routing.md +22 -0
- package/.claude/nccgs/protocols/orchestration.md +26 -0
- package/.claude/nccgs/protocols/unity-boundary.md +11 -0
- package/.claude/nccgs/settings.fragment.json +77 -0
- package/.claude/nccgs/studio.json +347 -0
- package/.claude/nccgs/tools/configure-models.mjs +39 -0
- package/.claude/nccgs/unity-skills-manifest.json +727 -0
- package/.claude/nccgs/workflow-catalog.json +317 -0
- package/.claude/rules/nccgs-canonical-docs.md +19 -0
- package/.claude/rules/nccgs-editor-tools.md +12 -0
- package/.claude/rules/nccgs-localization.md +12 -0
- package/.claude/rules/nccgs-networking.md +13 -0
- package/.claude/rules/nccgs-performance.md +14 -0
- package/.claude/rules/nccgs-rendering.md +16 -0
- package/.claude/rules/nccgs-security.md +13 -0
- package/.claude/rules/nccgs-tests.md +18 -0
- package/.claude/rules/nccgs-ui.md +14 -0
- package/.claude/rules/nccgs-unity-assets.md +21 -0
- package/.claude/rules/nccgs-unity-code.md +22 -0
- package/.claude/skills/accessibility-review/SKILL.md +14 -0
- package/.claude/skills/architecture-decision/SKILL.md +14 -0
- package/.claude/skills/asset-audit/SKILL.md +14 -0
- package/.claude/skills/audit/SKILL.md +16 -0
- package/.claude/skills/audit/references/dimensions.md +46 -0
- package/.claude/skills/balance-review/SKILL.md +14 -0
- package/.claude/skills/bug-triage/SKILL.md +14 -0
- package/.claude/skills/build-live-game/SKILL.md +317 -0
- package/.claude/skills/build-live-game/references/achievements.md +779 -0
- package/.claude/skills/build-live-game/references/apis.md +280 -0
- package/.claude/skills/build-live-game/references/authentication.md +437 -0
- package/.claude/skills/build-live-game/references/battlepass.md +860 -0
- package/.claude/skills/build-live-game/references/cloud-code.md +563 -0
- package/.claude/skills/build-live-game/references/cloud-save.md +474 -0
- package/.claude/skills/build-live-game/references/deployment.md +216 -0
- package/.claude/skills/build-live-game/references/player-account.md +813 -0
- package/.claude/skills/build-live-game/references/remote-config.md +96 -0
- package/.claude/skills/build-live-game/references/tooling.md +431 -0
- package/.claude/skills/closure/SKILL.md +14 -0
- package/.claude/skills/code-review/SKILL.md +14 -0
- package/.claude/skills/compatibility-review/SKILL.md +14 -0
- package/.claude/skills/context-pack/SKILL.md +14 -0
- package/.claude/skills/dependency-review/SKILL.md +14 -0
- package/.claude/skills/design/SKILL.md +20 -0
- package/.claude/skills/design-review/SKILL.md +14 -0
- package/.claude/skills/evidence-review/SKILL.md +14 -0
- package/.claude/skills/hotfix/SKILL.md +14 -0
- package/.claude/skills/implement-in-app-purchases/README.md +233 -0
- package/.claude/skills/implement-in-app-purchases/SKILL.md +158 -0
- package/.claude/skills/implement-in-app-purchases/references/api-notes.md +562 -0
- package/.claude/skills/implement-in-app-purchases/references/codeless-catalog.md +331 -0
- package/.claude/skills/implement-in-app-purchases/references/convert-adapty.md +268 -0
- package/.claude/skills/implement-in-app-purchases/references/convert-essentialkit.md +239 -0
- package/.claude/skills/implement-in-app-purchases/references/convert-revenuecat.md +275 -0
- package/.claude/skills/implement-in-app-purchases/references/convert-unipay.md +145 -0
- package/.claude/skills/implement-in-app-purchases/references/migration-v4-to-v5.md +204 -0
- package/.claude/skills/implement-in-app-purchases/references/path-add-iap-to-new-project.md +198 -0
- package/.claude/skills/implement-in-app-purchases/references/path-convert-native-google-billing.md +356 -0
- package/.claude/skills/implement-in-app-purchases/references/path-convert-native-storekit.md +446 -0
- package/.claude/skills/implement-in-app-purchases/references/path-implement-iap-d2c.md +680 -0
- package/.claude/skills/implement-in-app-purchases/references/platform-notes.md +204 -0
- package/.claude/skills/implement-in-app-purchases/references/pre-check.md +205 -0
- package/.claude/skills/incident-recovery/SKILL.md +14 -0
- package/.claude/skills/initialize-ai-navigation/SKILL.md +95 -0
- package/.claude/skills/initialize-ai-navigation/references/navigation-system.md +794 -0
- package/.claude/skills/levelplay-unity-integration/CHANGELOG.md +57 -0
- package/.claude/skills/levelplay-unity-integration/README.md +74 -0
- package/.claude/skills/levelplay-unity-integration/SKILL.md +1126 -0
- package/.claude/skills/levelplay-unity-integration/references/banner-api.md +920 -0
- package/.claude/skills/levelplay-unity-integration/references/best-practices.md +536 -0
- package/.claude/skills/levelplay-unity-integration/references/ilrd-api.md +337 -0
- package/.claude/skills/levelplay-unity-integration/references/initialization-api.md +630 -0
- package/.claude/skills/levelplay-unity-integration/references/interstitial-api.md +899 -0
- package/.claude/skills/levelplay-unity-integration/references/ios-setup.md +491 -0
- package/.claude/skills/levelplay-unity-integration/references/migration-sdk-9.md +666 -0
- package/.claude/skills/levelplay-unity-integration/references/privacy-settings.md +608 -0
- package/.claude/skills/levelplay-unity-integration/references/rewarded-api.md +902 -0
- package/.claude/skills/localization/SKILL.md +135 -0
- package/.claude/skills/localization/references/api-notes.md +76 -0
- package/.claude/skills/localization/resources/L10nBatchProcessor.cs +69 -0
- package/.claude/skills/localization/resources/LocalizedFontAsset.cs +18 -0
- package/.claude/skills/localize-game/SKILL.md +14 -0
- package/.claude/skills/migrate-project/SKILL.md +21 -0
- package/.claude/skills/migrate-project/references/procedure.md +63 -0
- package/.claude/skills/milestone-review/SKILL.md +14 -0
- package/.claude/skills/new-unity-project/SKILL.md +179 -0
- package/.claude/skills/optimize-audio/SKILL.md +199 -0
- package/.claude/skills/optimize-audio/resources/audio-import-api.md +146 -0
- package/.claude/skills/optimize-audio/resources/platform-settings.md +48 -0
- package/.claude/skills/optimize-text-mesh-pro/SKILL.md +182 -0
- package/.claude/skills/optimize-web/SKILL.md +393 -0
- package/.claude/skills/optimize-web/resources/WebOptimizer.cs +21 -0
- package/.claude/skills/optimize-web/resources/toktx-examples.sh +11 -0
- package/.claude/skills/performance-audit/SKILL.md +14 -0
- package/.claude/skills/physics-3d-collision/SKILL.md +442 -0
- package/.claude/skills/physics-3d-collision/references/troubleshooting.md +41 -0
- package/.claude/skills/physics-3d-collision/resources/CollisionDebugger.cs +33 -0
- package/.claude/skills/plan-feature/SKILL.md +14 -0
- package/.claude/skills/playtest/SKILL.md +14 -0
- package/.claude/skills/project-stage/SKILL.md +14 -0
- package/.claude/skills/prototype-feature/SKILL.md +14 -0
- package/.claude/skills/qa-plan/SKILL.md +14 -0
- package/.claude/skills/release/SKILL.md +18 -0
- package/.claude/skills/release-readiness/SKILL.md +14 -0
- package/.claude/skills/retrospective/SKILL.md +14 -0
- package/.claude/skills/review/SKILL.md +16 -0
- package/.claude/skills/security-audit/SKILL.md +14 -0
- package/.claude/skills/setup-multiplayer-services/SKILL.md +39 -0
- package/.claude/skills/setup-multiplayer-services/references/dgs-entrypoint.md +79 -0
- package/.claude/skills/setup-multiplayer-services/references/entrypoints.md +213 -0
- package/.claude/skills/setup-multiplayer-services/references/examples.md +33 -0
- package/.claude/skills/setup-multiplayer-services/references/implementation-fit.md +30 -0
- package/.claude/skills/setup-multiplayer-services/references/underlying-services.md +11 -0
- package/.claude/skills/setup-multiplayer-services/references/workflows-prerequisites.md +17 -0
- package/.claude/skills/setup-vivox-voice-chat/SKILL.md +118 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/.env.example +6 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/README.md +101 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/promptfooconfig.yaml +32 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/tests/init-and-login.yaml +76 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/tests/text-chat.yaml +65 -0
- package/.claude/skills/setup-vivox-voice-chat/evals/tests/voice-channels.yaml +74 -0
- package/.claude/skills/setup-vivox-voice-chat/references/events-and-participants.md +79 -0
- package/.claude/skills/setup-vivox-voice-chat/references/init-and-login.md +92 -0
- package/.claude/skills/setup-vivox-voice-chat/references/text-chat.md +93 -0
- package/.claude/skills/setup-vivox-voice-chat/references/troubleshooting.md +47 -0
- package/.claude/skills/setup-vivox-voice-chat/references/voice-channels.md +90 -0
- package/.claude/skills/shader-graph-create-custom-node/SKILL.md +25 -0
- package/.claude/skills/shader-graph-create-custom-node/resources/all_hints.hlsl +182 -0
- package/.claude/skills/sprint-plan/SKILL.md +14 -0
- package/.claude/skills/sprite-editor/SKILL.md +66 -0
- package/.claude/skills/sprite-editor/references/api_reference.md +151 -0
- package/.claude/skills/sprite-editor/references/background.md +112 -0
- package/.claude/skills/sprite-editor/references/templates.md +72 -0
- package/.claude/skills/sprite-editor/scripts/AutomaticSliceTexture.cs +40 -0
- package/.claude/skills/sprite-editor/scripts/GenerateNewSpriteRects.cs +200 -0
- package/.claude/skills/sprite-editor/scripts/GetTextureSourceImageSize.cs +32 -0
- package/.claude/skills/sprite-editor/scripts/GetTextureToSlice.cs +55 -0
- package/.claude/skills/sprite-editor/scripts/GridSliceTexture.cs +40 -0
- package/.claude/skills/sprite-editor/scripts/IsometricSliceTexture.cs +141 -0
- package/.claude/skills/sprite-editor/scripts/README.md +134 -0
- package/.claude/skills/sprite-editor/scripts/SetPivotExample.cs +58 -0
- package/.claude/skills/sprite-editor/scripts/SpriteToPng.cs +88 -0
- package/.claude/skills/status/SKILL.md +16 -0
- package/.claude/skills/story-readiness/SKILL.md +14 -0
- package/.claude/skills/test/SKILL.md +16 -0
- package/.claude/skills/ui/SKILL.md +142 -0
- package/.claude/skills/ui-imgui/SKILL.md +186 -0
- package/.claude/skills/ui-imgui/references/gui-elements.md +156 -0
- package/.claude/skills/ui-imgui/references/templates.md +141 -0
- package/.claude/skills/ui-review/SKILL.md +14 -0
- package/.claude/skills/ui-ugui/SKILL.md +282 -0
- package/.claude/skills/ui-ugui/references/scrollview-setup.md +29 -0
- package/.claude/skills/ui-uitk/SKILL.md +235 -0
- package/.claude/skills/ui-uitk/references/common-issues.md +74 -0
- package/.claude/skills/ui-uitk/references/custom-elements.md +241 -0
- package/.claude/skills/ui-uitk/references/painter2d.md +282 -0
- package/.claude/skills/ui-uitk/references/pointermanipulator-guide.md +94 -0
- package/.claude/skills/ui-uitk/references/svg-icons.md +136 -0
- package/.claude/skills/ui-uitk/references/ui-runtime-binding.md +234 -0
- package/.claude/skills/ui-uitk/references/uss-guide.md +138 -0
- package/.claude/skills/unity-cli/CHANGELOG.md +233 -0
- package/.claude/skills/unity-cli/SECURITY.md +22 -0
- package/.claude/skills/unity-cli/SKILL.md +414 -0
- package/.claude/skills/unity-cli/references/auth-license-cloud.md +146 -0
- package/.claude/skills/unity-cli/references/build-run-test.md +349 -0
- package/.claude/skills/unity-cli/references/collaboration.md +472 -0
- package/.claude/skills/unity-cli/references/config-hub.md +103 -0
- package/.claude/skills/unity-cli/references/diagnostics-maintenance.md +326 -0
- package/.claude/skills/unity-cli/references/editors-install.md +327 -0
- package/.claude/skills/unity-cli/references/integration-advanced.md +472 -0
- package/.claude/skills/unity-cli/references/projects-templates.md +574 -0
- package/.claude/skills/unity-package-management/SKILL.md +304 -0
- package/.claude/skills/unity-package-management/references/select-packages.md +108 -0
- package/.claude/skills/urp-postprocessing/SKILL.md +188 -0
- package/.claude/skills/urp-postprocessing/references/code-templates.md +119 -0
- package/.claude/skills/urp-postprocessing/references/effect-reference.md +86 -0
- package/.claude/skills/validate-urp-render-graph-renderer-feature/SKILL.md +269 -0
- package/.claude/skills/work/SKILL.md +36 -0
- package/.claude/skills/work/references/classification.md +41 -0
- package/.claude/skills/work/references/closure.md +50 -0
- package/.claude/skills/work/references/feature-contracts.md +32 -0
- package/.claude/skills/work/references/verification.md +26 -0
- package/CLAUDE.md +6 -0
- package/LICENSE +21 -0
- package/README.md +162 -0
- package/THIRD_PARTY_NOTICES.md +23 -0
- package/UPGRADING.md +32 -0
- package/VERSION +1 -0
- package/docs/ARCHITECTURE.md +73 -0
- package/docs/HUONG-DAN-MIGRATE-VA-SU-DUNG.md +324 -0
- package/docs/MIGRATION-MATRIX.md +23 -0
- package/docs/PROJECT-POLICY.md +67 -0
- package/docs/WORKFLOWS.md +61 -0
- package/package-assets/setup-vivox-voice-chat-evals.gitignore +7 -0
- package/package.json +41 -0
- package/scaffold/.nccgs/bugs/.gitkeep +1 -0
- package/scaffold/.nccgs/closures/.gitkeep +1 -0
- package/scaffold/.nccgs/context/.gitkeep +1 -0
- package/scaffold/.nccgs/decisions/.gitkeep +1 -0
- package/scaffold/.nccgs/evidence/.gitkeep +1 -0
- package/scaffold/.nccgs/features/.gitkeep +1 -0
- package/scaffold/.nccgs/migrations/.gitkeep +1 -0
- package/scaffold/.nccgs/playtests/.gitkeep +1 -0
- package/scaffold/.nccgs/project.yaml +103 -0
- package/scaffold/.nccgs/requirements.yaml +10 -0
- package/scaffold/.nccgs/reviews/.gitkeep +1 -0
- package/scaffold/.nccgs/state.md +40 -0
- package/scaffold/.nccgs/templates/agent-handoff.md +25 -0
- package/scaffold/.nccgs/templates/architecture-decision.md +27 -0
- package/scaffold/.nccgs/templates/closure-record.md +51 -0
- package/scaffold/.nccgs/templates/context-packet.yaml +17 -0
- package/scaffold/.nccgs/templates/evidence-record.md +23 -0
- package/scaffold/.nccgs/templates/feature-contract.md +35 -0
- package/scaffold/.nccgs/templates/migration-plan.md +40 -0
- package/scaffold/.nccgs/templates/waiver.md +11 -0
- package/scripts/cli.mjs +56 -0
- package/scripts/install.mjs +267 -0
- package/scripts/sync-unity-skills.mjs +126 -0
- package/scripts/validate.mjs +205 -0
- package/tests/framework.test.mjs +121 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
# Services APIs Reference
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [Overview](#overview)
|
|
6
|
+
- [When to Use This Package](#when-to-use-this-package)
|
|
7
|
+
- [Four Client Types](#four-client-types)
|
|
8
|
+
- [IAdminClient](#iadminclient)
|
|
9
|
+
- [Service Area Properties](#iadminclient-service-area-properties)
|
|
10
|
+
- [Authentication](#iadminclient-authentication)
|
|
11
|
+
- [ICloudSaveDataAdminApi](#icloudsavedataadminapi)
|
|
12
|
+
- [IGameClient](#igameclient)
|
|
13
|
+
- [IServerClient](#iserverclient)
|
|
14
|
+
- [ITrustedClient](#itrustedclient)
|
|
15
|
+
- [Code Templates](#code-templates)
|
|
16
|
+
- [Set Up an Admin Client](#set-up-an-admin-client)
|
|
17
|
+
- [Write Game Data (Custom Data) from the Editor](#write-game-data-custom-data-from-the-editor)
|
|
18
|
+
- [Write Player Data from the Editor](#write-player-data-from-the-editor)
|
|
19
|
+
- [Set Up a Game Client](#set-up-a-game-client-player-device)
|
|
20
|
+
- [Set Up a Server Client](#set-up-a-server-client)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Overview
|
|
25
|
+
|
|
26
|
+
Unified entry point for Unity Gaming Services client types. Provides auto-generated REST clients for all UGS services through a single dependency.
|
|
27
|
+
|
|
28
|
+
- **Package:** `com.unity.services.apis`
|
|
29
|
+
- **Namespace:** `Unity.Services.Apis`
|
|
30
|
+
- **Assembly:** `Unity.Services.Apis`
|
|
31
|
+
- **Availability:** `IAdminClient` is editor-only (`#if UNITY_EDITOR`). Game/Server/Trusted clients work at runtime.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## When to Use This Package
|
|
36
|
+
|
|
37
|
+
> **CRITICAL — all admin API interactions go through `com.unity.services.apis`.**
|
|
38
|
+
> Any editor tool, Deployment Window integration, or server-side script that needs to read
|
|
39
|
+
> or write UGS data with elevated privileges must use this package. There is no other
|
|
40
|
+
> supported path for admin-level operations from within the Unity Editor.
|
|
41
|
+
|
|
42
|
+
Use cases for `IAdminClient`:
|
|
43
|
+
|
|
44
|
+
- **Deployment Window custom providers** — deploy commands that write to Cloud Save, Economy, Leaderboards, etc.
|
|
45
|
+
- **Editor tools** — custom inspectors or windows that read/write game-wide data
|
|
46
|
+
- **Build pipelines** — pre-build steps that push config data to UGS
|
|
47
|
+
|
|
48
|
+
Use `IGameClient` for runtime player-facing code. Use `IServerClient` / `ITrustedClient` for dedicated game servers.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Four Client Types
|
|
53
|
+
|
|
54
|
+
| Client | Interface | Context | Auth |
|
|
55
|
+
|---|---|---|---|
|
|
56
|
+
| Admin | `IAdminClient` | Editor tools, deployment integrations | Service account (key ID + secret) |
|
|
57
|
+
| Game | `IGameClient` | Player device at runtime | Player sign-in (anonymous, Unity, password) |
|
|
58
|
+
| Server | `IServerClient` | Dedicated game servers | Server key |
|
|
59
|
+
| Trusted | `ITrustedClient` | Servers needing admin-level player data access | Service account |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## IAdminClient
|
|
64
|
+
|
|
65
|
+
Used for backend tooling, editor extensions, Deployment Window integrations, and any operation that requires elevated privileges. **Editor-only** — guarded by `#if UNITY_EDITOR || ENABLE_RUNTIME_ADMIN_APIS`.
|
|
66
|
+
|
|
67
|
+
### IAdminClient Authentication
|
|
68
|
+
|
|
69
|
+
```csharp
|
|
70
|
+
using Unity.Services.Apis;
|
|
71
|
+
|
|
72
|
+
var adminClient = UnityServicesApiClient.AdminClient;
|
|
73
|
+
adminClient.SetServiceAccount(keyId, keySecret);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Service account credentials are created in the Unity Dashboard under **Project Settings > Service Accounts**. The key ID and secret are passed at runtime — do not hard-code them.
|
|
77
|
+
|
|
78
|
+
### IAdminClient Service Area Properties
|
|
79
|
+
|
|
80
|
+
| Property | Type | Service |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| `CloudSaveData` | `ICloudSaveDataAdminApi` | Cloud Save — player data, custom (game-wide) data, all access classes |
|
|
83
|
+
| `CloudSaveFiles` | `ICloudSaveFilesAdminApi` | Cloud Save — file storage |
|
|
84
|
+
| `CloudCodeModules` | `ICloudCodeModulesAdminApi` | Cloud Code — C# modules |
|
|
85
|
+
| `CloudCodeScripts` | `ICloudCodeScriptsAdminApi` | Cloud Code — JS scripts |
|
|
86
|
+
| `Economy` | `IEconomyAdminApi` | Economy — config and player data |
|
|
87
|
+
| `RemoteConfig` | `IConfigsAdminApi` | Remote Config |
|
|
88
|
+
| `RemoteConfigSchemas` | `ISchemasAdminApi` | Remote Config schemas |
|
|
89
|
+
| `GameOverrides` | `IGameOverridesAdminApi` | Game Overrides |
|
|
90
|
+
| `Leaderboards` | `ILeaderboardsAdminApi` | Leaderboards |
|
|
91
|
+
| `Environment` | `IEnvironmentAdminApi` | Environment management |
|
|
92
|
+
| `Logs` | `ILogsAdminApi` | Logs |
|
|
93
|
+
| `PlayerAuthentication` | `IPlayerAuthenticationAdminApi` | Player auth management |
|
|
94
|
+
| `PlayerPolicy` | `IPlayerPolicyAdminApi` | Player access policies |
|
|
95
|
+
| `ProjectPolicy` | `IProjectPolicyAdminApi` | Project access policies |
|
|
96
|
+
| `Scheduler` | `ISchedulerAdminApi` | Scheduler |
|
|
97
|
+
| `ServiceAuthentication` | `IServiceAuthenticationAdminApi` | Service auth |
|
|
98
|
+
| `Triggers` | `ITriggersAdminApi` | Triggers |
|
|
99
|
+
|
|
100
|
+
### ICloudSaveDataAdminApi
|
|
101
|
+
|
|
102
|
+
This is the key interface for reading and writing Cloud Save data with admin privileges. All methods require `projectId` and `environmentId`.
|
|
103
|
+
|
|
104
|
+
#### Player Data (all access classes)
|
|
105
|
+
|
|
106
|
+
| Method | Description |
|
|
107
|
+
|---|---|
|
|
108
|
+
| `GetItems(projectId, envId, playerId, keys?, after?)` | Get player items (Default bucket) |
|
|
109
|
+
| `SetItem(projectId, envId, playerId, body)` | Set a player item |
|
|
110
|
+
| `SetItemBatch(projectId, envId, playerId, body)` | Set multiple player items |
|
|
111
|
+
| `DeleteItem(projectId, envId, playerId, key, writeLock?)` | Delete a player item |
|
|
112
|
+
| `DeleteItems(projectId, envId, playerId)` | Delete all player items |
|
|
113
|
+
| `GetKeys(projectId, envId, playerId, after?)` | List player keys |
|
|
114
|
+
|
|
115
|
+
Same pattern for **Public** (`GetPublicItems`, `SetPublicItem`, etc.) and **Protected** (`GetProtectedItems`, `SetProtectedItem`, etc.).
|
|
116
|
+
|
|
117
|
+
#### Custom Data (game-wide)
|
|
118
|
+
|
|
119
|
+
Custom Data is game-wide key-value storage not tied to any player. The `customId` parameter is a namespace (1-50 chars, alphanumeric/underscores/hyphens).
|
|
120
|
+
|
|
121
|
+
| Method | Description |
|
|
122
|
+
|---|---|
|
|
123
|
+
| `GetCustomItems(projectId, envId, customId, keys?, after?)` | Read game-wide items |
|
|
124
|
+
| `SetCustomItem(projectId, envId, customId, body)` | Write a game-wide item |
|
|
125
|
+
| `SetCustomItemBatch(projectId, envId, customId, body)` | Write multiple game-wide items |
|
|
126
|
+
| `DeleteCustomItem(projectId, envId, customId, key, writeLock?)` | Delete a game-wide item |
|
|
127
|
+
| `DeleteCustomItems(projectId, envId, customId)` | Delete all items in a custom namespace |
|
|
128
|
+
| `GetCustomKeys(projectId, envId, customId, after?)` | List keys in a custom namespace |
|
|
129
|
+
|
|
130
|
+
Same pattern for **Private Custom** (`GetPrivateCustomItems`, `SetPrivateCustomItem`, etc.).
|
|
131
|
+
|
|
132
|
+
> **This is how you write game data from the editor.** The client SDK's `ICustomDataService`
|
|
133
|
+
> is read-only — only `IAdminClient.CloudSaveData` can write to Custom Data.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## IGameClient
|
|
138
|
+
|
|
139
|
+
Created via `UnityServicesApiClient.GameClient` after player authentication. Runtime only.
|
|
140
|
+
|
|
141
|
+
| Property | Type | Service |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| `CloudSaveData` | `ICloudSaveDataApi` | Cloud Save player data |
|
|
144
|
+
| `CloudSaveFiles` | `ICloudSaveFilesApi` | Cloud Save files |
|
|
145
|
+
| `CloudCode` | `ICloudCodeApi` | Cloud Code invocation |
|
|
146
|
+
| `EconomyConfiguration` | `IEconomyConfigurationApi` | Economy config |
|
|
147
|
+
| `EconomyCurrencies` | `IEconomyCurrenciesApi` | Currency balances |
|
|
148
|
+
| `EconomyInventory` | `IEconomyInventoryApi` | Player inventory |
|
|
149
|
+
| `EconomyPurchases` | `IEconomyPurchasesApi` | Purchases |
|
|
150
|
+
| `Leaderboards` | `ILeaderboardsApi` | Leaderboard scores |
|
|
151
|
+
| `Lobby` | `ILobbyApi` | Lobby management |
|
|
152
|
+
| `RemoteConfig` | `IRemoteConfigSettingsApi` | Remote Config |
|
|
153
|
+
| `PlayerAuthentication` | `IPlayerAuthenticationApi` | Auth management |
|
|
154
|
+
| `PlayerNames` | `IPlayerNamesApi` | Display names |
|
|
155
|
+
| `FriendsRelationships` | `IFriendsRelationshipsApi` | Friend lists |
|
|
156
|
+
| `FriendsPresence` | `IFriendsPresenceApi` | Presence |
|
|
157
|
+
| `RelayAllocations` | `IRelayAllocationsApi` | Relay |
|
|
158
|
+
| `QosDiscovery` | `IQosDiscoveryApi` | QoS |
|
|
159
|
+
| `Analytics` | `IAnalyticsApi` | Analytics |
|
|
160
|
+
|
|
161
|
+
Most developers use the high-level SDKs (`CloudSaveService.Instance`, `EconomyService.Instance`) instead of `IGameClient` directly.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## IServerClient
|
|
166
|
+
|
|
167
|
+
Used from dedicated game servers. Authenticated with a server key or service account.
|
|
168
|
+
|
|
169
|
+
```csharp
|
|
170
|
+
var serverClient = UnityServicesApiClient.ServerClient;
|
|
171
|
+
await serverClient.SignInFromServer();
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
| Property | Type | Service |
|
|
175
|
+
|---|---|---|
|
|
176
|
+
| `CloudSaveData` | `ICloudSaveDataApi` | Cloud Save player data |
|
|
177
|
+
| `CloudSaveFiles` | `ICloudSaveFilesApi` | Cloud Save files |
|
|
178
|
+
| `CloudCode` | `ICloudCodeApi` | Cloud Code |
|
|
179
|
+
| `EconomyConfiguration` | `IEconomyConfigurationApi` | Economy config |
|
|
180
|
+
| `EconomyCurrencies` | `IEconomyCurrenciesApi` | Currencies |
|
|
181
|
+
| `EconomyInventory` | `IEconomyInventoryApi` | Inventory |
|
|
182
|
+
| `EconomyPurchases` | `IEconomyPurchasesApi` | Purchases |
|
|
183
|
+
| `Leaderboards` | `ILeaderboardsApi` | Leaderboards |
|
|
184
|
+
| `Lobby` | `ILobbyApi` | Lobbies |
|
|
185
|
+
| `PlayerNames` | `IPlayerNamesApi` | Display names |
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## ITrustedClient
|
|
190
|
+
|
|
191
|
+
Elevated server client with admin-equivalent access to player data. Use when a dedicated server needs to read or modify any player's data with elevated privileges.
|
|
192
|
+
|
|
193
|
+
```csharp
|
|
194
|
+
var trustedClient = UnityServicesApiClient.TrustedClient;
|
|
195
|
+
trustedClient.SetServiceAccount(keyId, keySecret);
|
|
196
|
+
await trustedClient.SignInWithServiceAccount(projectId, environmentId);
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Same service area properties as `IServerClient`, plus `PlayerAuthentication` and `MultiplayAllocations`/`MultiplayFleets`.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Code Templates
|
|
204
|
+
|
|
205
|
+
### Set Up an Admin Client
|
|
206
|
+
|
|
207
|
+
```csharp
|
|
208
|
+
using Unity.Services.Apis;
|
|
209
|
+
|
|
210
|
+
// Admin client is editor-only. Guard with #if UNITY_EDITOR in runtime assemblies.
|
|
211
|
+
var adminClient = UnityServicesApiClient.AdminClient;
|
|
212
|
+
adminClient.SetServiceAccount("your-key-id", "your-key-secret");
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Write Game Data (Custom Data) from the Editor
|
|
216
|
+
|
|
217
|
+
This is the pattern for Deployment Window integrations that push JSON into Cloud Save Custom Data.
|
|
218
|
+
|
|
219
|
+
```csharp
|
|
220
|
+
using Unity.Services.Apis;
|
|
221
|
+
using Unity.Services.Apis.Admin.CloudSave;
|
|
222
|
+
|
|
223
|
+
var adminClient = UnityServicesApiClient.AdminClient;
|
|
224
|
+
adminClient.SetServiceAccount(keyId, keySecret);
|
|
225
|
+
|
|
226
|
+
string projectId = CloudProjectSettings.projectId;
|
|
227
|
+
string environmentId = "your-environment-id";
|
|
228
|
+
string customId = "game-config"; // namespace for your game-wide data
|
|
229
|
+
|
|
230
|
+
// Write a single item
|
|
231
|
+
var body = new SetItemBody("level_data", levelDataJson);
|
|
232
|
+
await adminClient.CloudSaveData.SetCustomItem(projectId, environmentId, customId, body);
|
|
233
|
+
|
|
234
|
+
// Write multiple items in a batch
|
|
235
|
+
var batchBody = new SetItemBatchBody(new List<SetItemBatchBodyItem>
|
|
236
|
+
{
|
|
237
|
+
new SetItemBatchBodyItem("enemies", enemiesJson),
|
|
238
|
+
new SetItemBatchBodyItem("weapons", weaponsJson)
|
|
239
|
+
});
|
|
240
|
+
await adminClient.CloudSaveData.SetCustomItemBatch(projectId, environmentId, customId, batchBody);
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Write Player Data from the Editor
|
|
244
|
+
|
|
245
|
+
```csharp
|
|
246
|
+
// Write to a specific player's Protected bucket
|
|
247
|
+
var body = new SetItemBody("achievements", achievementsJson);
|
|
248
|
+
await adminClient.CloudSaveData.SetProtectedItem(
|
|
249
|
+
projectId, environmentId, playerId, body);
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Set Up a Game Client (Player Device)
|
|
253
|
+
|
|
254
|
+
```csharp
|
|
255
|
+
using Unity.Services.Core;
|
|
256
|
+
using Unity.Services.Authentication;
|
|
257
|
+
using Unity.Services.Apis;
|
|
258
|
+
|
|
259
|
+
async Task SetupGameClient()
|
|
260
|
+
{
|
|
261
|
+
await UnityServices.InitializeAsync();
|
|
262
|
+
await AuthenticationService.Instance.SignInAnonymouslyAsync();
|
|
263
|
+
|
|
264
|
+
// Game client is automatically authenticated via the signed-in player
|
|
265
|
+
var client = UnityServicesApiClient.GameClient;
|
|
266
|
+
var scores = await client.Leaderboards.GetScoresAsync("WEEKLY_LB");
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Set Up a Server Client
|
|
271
|
+
|
|
272
|
+
```csharp
|
|
273
|
+
using Unity.Services.Apis;
|
|
274
|
+
|
|
275
|
+
// serverAuthToken provided by the Multiplay server environment
|
|
276
|
+
var serverClient = UnityServicesApiClient.ServerClient;
|
|
277
|
+
await serverClient.SignInFromServer();
|
|
278
|
+
|
|
279
|
+
await serverClient.Lobby.CreateOrJoinLobbyAsync(...);
|
|
280
|
+
```
|