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.
Files changed (278) hide show
  1. package/.claude/agents/nccgs-accessibility-specialist.md +26 -0
  2. package/.claude/agents/nccgs-adversarial-reviewer.md +26 -0
  3. package/.claude/agents/nccgs-ai-programmer.md +26 -0
  4. package/.claude/agents/nccgs-analytics-engineer.md +26 -0
  5. package/.claude/agents/nccgs-art-direction-lead.md +26 -0
  6. package/.claude/agents/nccgs-audio-direction-lead.md +26 -0
  7. package/.claude/agents/nccgs-creative-director.md +26 -0
  8. package/.claude/agents/nccgs-documentation-manager.md +26 -0
  9. package/.claude/agents/nccgs-economy-designer.md +26 -0
  10. package/.claude/agents/nccgs-engine-programmer.md +26 -0
  11. package/.claude/agents/nccgs-game-design-lead.md +26 -0
  12. package/.claude/agents/nccgs-game-designer.md +26 -0
  13. package/.claude/agents/nccgs-gameplay-programmer.md +26 -0
  14. package/.claude/agents/nccgs-level-designer.md +26 -0
  15. package/.claude/agents/nccgs-live-ops-designer.md +26 -0
  16. package/.claude/agents/nccgs-localization-lead.md +26 -0
  17. package/.claude/agents/nccgs-narrative-lead.md +26 -0
  18. package/.claude/agents/nccgs-network-programmer.md +26 -0
  19. package/.claude/agents/nccgs-performance-analyst.md +26 -0
  20. package/.claude/agents/nccgs-producer.md +26 -0
  21. package/.claude/agents/nccgs-production-coordinator.md +23 -0
  22. package/.claude/agents/nccgs-programming-lead.md +26 -0
  23. package/.claude/agents/nccgs-prototyper.md +26 -0
  24. package/.claude/agents/nccgs-qa-engineer.md +26 -0
  25. package/.claude/agents/nccgs-qa-lead.md +26 -0
  26. package/.claude/agents/nccgs-release-engineer.md +26 -0
  27. package/.claude/agents/nccgs-release-lead.md +26 -0
  28. package/.claude/agents/nccgs-security-engineer.md +26 -0
  29. package/.claude/agents/nccgs-sound-designer.md +26 -0
  30. package/.claude/agents/nccgs-systems-designer.md +26 -0
  31. package/.claude/agents/nccgs-technical-architect.md +26 -0
  32. package/.claude/agents/nccgs-technical-artist.md +26 -0
  33. package/.claude/agents/nccgs-technical-director.md +26 -0
  34. package/.claude/agents/nccgs-tools-programmer.md +26 -0
  35. package/.claude/agents/nccgs-ui-programmer.md +26 -0
  36. package/.claude/agents/nccgs-unity-build-specialist.md +26 -0
  37. package/.claude/agents/nccgs-unity-content-specialist.md +26 -0
  38. package/.claude/agents/nccgs-unity-implementer.md +26 -0
  39. package/.claude/agents/nccgs-unity-rendering-specialist.md +26 -0
  40. package/.claude/agents/nccgs-unity-systems-specialist.md +26 -0
  41. package/.claude/agents/nccgs-unity-ui-specialist.md +26 -0
  42. package/.claude/agents/nccgs-ux-designer.md +26 -0
  43. package/.claude/agents/nccgs-verification-engineer.md +26 -0
  44. package/.claude/agents/nccgs-world-builder.md +26 -0
  45. package/.claude/agents/nccgs-writer.md +26 -0
  46. package/.claude/nccgs/THIRD_PARTY_NOTICES.md +13 -0
  47. package/.claude/nccgs/VERSION +1 -0
  48. package/.claude/nccgs/constitution.md +131 -0
  49. package/.claude/nccgs/hooks/agent-audit.mjs +10 -0
  50. package/.claude/nccgs/hooks/common.mjs +41 -0
  51. package/.claude/nccgs/hooks/post-compact.mjs +1 -0
  52. package/.claude/nccgs/hooks/pre-compact.mjs +8 -0
  53. package/.claude/nccgs/hooks/protect-git.mjs +22 -0
  54. package/.claude/nccgs/hooks/protect-write.mjs +17 -0
  55. package/.claude/nccgs/hooks/session-start.mjs +15 -0
  56. package/.claude/nccgs/hooks/session-stop.mjs +7 -0
  57. package/.claude/nccgs/protocols/agent-contract.md +34 -0
  58. package/.claude/nccgs/protocols/context-packets.md +13 -0
  59. package/.claude/nccgs/protocols/evidence.md +15 -0
  60. package/.claude/nccgs/protocols/model-routing.md +22 -0
  61. package/.claude/nccgs/protocols/orchestration.md +26 -0
  62. package/.claude/nccgs/protocols/unity-boundary.md +11 -0
  63. package/.claude/nccgs/settings.fragment.json +77 -0
  64. package/.claude/nccgs/studio.json +347 -0
  65. package/.claude/nccgs/tools/configure-models.mjs +39 -0
  66. package/.claude/nccgs/unity-skills-manifest.json +727 -0
  67. package/.claude/nccgs/workflow-catalog.json +317 -0
  68. package/.claude/rules/nccgs-canonical-docs.md +19 -0
  69. package/.claude/rules/nccgs-editor-tools.md +12 -0
  70. package/.claude/rules/nccgs-localization.md +12 -0
  71. package/.claude/rules/nccgs-networking.md +13 -0
  72. package/.claude/rules/nccgs-performance.md +14 -0
  73. package/.claude/rules/nccgs-rendering.md +16 -0
  74. package/.claude/rules/nccgs-security.md +13 -0
  75. package/.claude/rules/nccgs-tests.md +18 -0
  76. package/.claude/rules/nccgs-ui.md +14 -0
  77. package/.claude/rules/nccgs-unity-assets.md +21 -0
  78. package/.claude/rules/nccgs-unity-code.md +22 -0
  79. package/.claude/skills/accessibility-review/SKILL.md +14 -0
  80. package/.claude/skills/architecture-decision/SKILL.md +14 -0
  81. package/.claude/skills/asset-audit/SKILL.md +14 -0
  82. package/.claude/skills/audit/SKILL.md +16 -0
  83. package/.claude/skills/audit/references/dimensions.md +46 -0
  84. package/.claude/skills/balance-review/SKILL.md +14 -0
  85. package/.claude/skills/bug-triage/SKILL.md +14 -0
  86. package/.claude/skills/build-live-game/SKILL.md +317 -0
  87. package/.claude/skills/build-live-game/references/achievements.md +779 -0
  88. package/.claude/skills/build-live-game/references/apis.md +280 -0
  89. package/.claude/skills/build-live-game/references/authentication.md +437 -0
  90. package/.claude/skills/build-live-game/references/battlepass.md +860 -0
  91. package/.claude/skills/build-live-game/references/cloud-code.md +563 -0
  92. package/.claude/skills/build-live-game/references/cloud-save.md +474 -0
  93. package/.claude/skills/build-live-game/references/deployment.md +216 -0
  94. package/.claude/skills/build-live-game/references/player-account.md +813 -0
  95. package/.claude/skills/build-live-game/references/remote-config.md +96 -0
  96. package/.claude/skills/build-live-game/references/tooling.md +431 -0
  97. package/.claude/skills/closure/SKILL.md +14 -0
  98. package/.claude/skills/code-review/SKILL.md +14 -0
  99. package/.claude/skills/compatibility-review/SKILL.md +14 -0
  100. package/.claude/skills/context-pack/SKILL.md +14 -0
  101. package/.claude/skills/dependency-review/SKILL.md +14 -0
  102. package/.claude/skills/design/SKILL.md +20 -0
  103. package/.claude/skills/design-review/SKILL.md +14 -0
  104. package/.claude/skills/evidence-review/SKILL.md +14 -0
  105. package/.claude/skills/hotfix/SKILL.md +14 -0
  106. package/.claude/skills/implement-in-app-purchases/README.md +233 -0
  107. package/.claude/skills/implement-in-app-purchases/SKILL.md +158 -0
  108. package/.claude/skills/implement-in-app-purchases/references/api-notes.md +562 -0
  109. package/.claude/skills/implement-in-app-purchases/references/codeless-catalog.md +331 -0
  110. package/.claude/skills/implement-in-app-purchases/references/convert-adapty.md +268 -0
  111. package/.claude/skills/implement-in-app-purchases/references/convert-essentialkit.md +239 -0
  112. package/.claude/skills/implement-in-app-purchases/references/convert-revenuecat.md +275 -0
  113. package/.claude/skills/implement-in-app-purchases/references/convert-unipay.md +145 -0
  114. package/.claude/skills/implement-in-app-purchases/references/migration-v4-to-v5.md +204 -0
  115. package/.claude/skills/implement-in-app-purchases/references/path-add-iap-to-new-project.md +198 -0
  116. package/.claude/skills/implement-in-app-purchases/references/path-convert-native-google-billing.md +356 -0
  117. package/.claude/skills/implement-in-app-purchases/references/path-convert-native-storekit.md +446 -0
  118. package/.claude/skills/implement-in-app-purchases/references/path-implement-iap-d2c.md +680 -0
  119. package/.claude/skills/implement-in-app-purchases/references/platform-notes.md +204 -0
  120. package/.claude/skills/implement-in-app-purchases/references/pre-check.md +205 -0
  121. package/.claude/skills/incident-recovery/SKILL.md +14 -0
  122. package/.claude/skills/initialize-ai-navigation/SKILL.md +95 -0
  123. package/.claude/skills/initialize-ai-navigation/references/navigation-system.md +794 -0
  124. package/.claude/skills/levelplay-unity-integration/CHANGELOG.md +57 -0
  125. package/.claude/skills/levelplay-unity-integration/README.md +74 -0
  126. package/.claude/skills/levelplay-unity-integration/SKILL.md +1126 -0
  127. package/.claude/skills/levelplay-unity-integration/references/banner-api.md +920 -0
  128. package/.claude/skills/levelplay-unity-integration/references/best-practices.md +536 -0
  129. package/.claude/skills/levelplay-unity-integration/references/ilrd-api.md +337 -0
  130. package/.claude/skills/levelplay-unity-integration/references/initialization-api.md +630 -0
  131. package/.claude/skills/levelplay-unity-integration/references/interstitial-api.md +899 -0
  132. package/.claude/skills/levelplay-unity-integration/references/ios-setup.md +491 -0
  133. package/.claude/skills/levelplay-unity-integration/references/migration-sdk-9.md +666 -0
  134. package/.claude/skills/levelplay-unity-integration/references/privacy-settings.md +608 -0
  135. package/.claude/skills/levelplay-unity-integration/references/rewarded-api.md +902 -0
  136. package/.claude/skills/localization/SKILL.md +135 -0
  137. package/.claude/skills/localization/references/api-notes.md +76 -0
  138. package/.claude/skills/localization/resources/L10nBatchProcessor.cs +69 -0
  139. package/.claude/skills/localization/resources/LocalizedFontAsset.cs +18 -0
  140. package/.claude/skills/localize-game/SKILL.md +14 -0
  141. package/.claude/skills/migrate-project/SKILL.md +21 -0
  142. package/.claude/skills/migrate-project/references/procedure.md +63 -0
  143. package/.claude/skills/milestone-review/SKILL.md +14 -0
  144. package/.claude/skills/new-unity-project/SKILL.md +179 -0
  145. package/.claude/skills/optimize-audio/SKILL.md +199 -0
  146. package/.claude/skills/optimize-audio/resources/audio-import-api.md +146 -0
  147. package/.claude/skills/optimize-audio/resources/platform-settings.md +48 -0
  148. package/.claude/skills/optimize-text-mesh-pro/SKILL.md +182 -0
  149. package/.claude/skills/optimize-web/SKILL.md +393 -0
  150. package/.claude/skills/optimize-web/resources/WebOptimizer.cs +21 -0
  151. package/.claude/skills/optimize-web/resources/toktx-examples.sh +11 -0
  152. package/.claude/skills/performance-audit/SKILL.md +14 -0
  153. package/.claude/skills/physics-3d-collision/SKILL.md +442 -0
  154. package/.claude/skills/physics-3d-collision/references/troubleshooting.md +41 -0
  155. package/.claude/skills/physics-3d-collision/resources/CollisionDebugger.cs +33 -0
  156. package/.claude/skills/plan-feature/SKILL.md +14 -0
  157. package/.claude/skills/playtest/SKILL.md +14 -0
  158. package/.claude/skills/project-stage/SKILL.md +14 -0
  159. package/.claude/skills/prototype-feature/SKILL.md +14 -0
  160. package/.claude/skills/qa-plan/SKILL.md +14 -0
  161. package/.claude/skills/release/SKILL.md +18 -0
  162. package/.claude/skills/release-readiness/SKILL.md +14 -0
  163. package/.claude/skills/retrospective/SKILL.md +14 -0
  164. package/.claude/skills/review/SKILL.md +16 -0
  165. package/.claude/skills/security-audit/SKILL.md +14 -0
  166. package/.claude/skills/setup-multiplayer-services/SKILL.md +39 -0
  167. package/.claude/skills/setup-multiplayer-services/references/dgs-entrypoint.md +79 -0
  168. package/.claude/skills/setup-multiplayer-services/references/entrypoints.md +213 -0
  169. package/.claude/skills/setup-multiplayer-services/references/examples.md +33 -0
  170. package/.claude/skills/setup-multiplayer-services/references/implementation-fit.md +30 -0
  171. package/.claude/skills/setup-multiplayer-services/references/underlying-services.md +11 -0
  172. package/.claude/skills/setup-multiplayer-services/references/workflows-prerequisites.md +17 -0
  173. package/.claude/skills/setup-vivox-voice-chat/SKILL.md +118 -0
  174. package/.claude/skills/setup-vivox-voice-chat/evals/.env.example +6 -0
  175. package/.claude/skills/setup-vivox-voice-chat/evals/README.md +101 -0
  176. package/.claude/skills/setup-vivox-voice-chat/evals/promptfooconfig.yaml +32 -0
  177. package/.claude/skills/setup-vivox-voice-chat/evals/tests/init-and-login.yaml +76 -0
  178. package/.claude/skills/setup-vivox-voice-chat/evals/tests/text-chat.yaml +65 -0
  179. package/.claude/skills/setup-vivox-voice-chat/evals/tests/voice-channels.yaml +74 -0
  180. package/.claude/skills/setup-vivox-voice-chat/references/events-and-participants.md +79 -0
  181. package/.claude/skills/setup-vivox-voice-chat/references/init-and-login.md +92 -0
  182. package/.claude/skills/setup-vivox-voice-chat/references/text-chat.md +93 -0
  183. package/.claude/skills/setup-vivox-voice-chat/references/troubleshooting.md +47 -0
  184. package/.claude/skills/setup-vivox-voice-chat/references/voice-channels.md +90 -0
  185. package/.claude/skills/shader-graph-create-custom-node/SKILL.md +25 -0
  186. package/.claude/skills/shader-graph-create-custom-node/resources/all_hints.hlsl +182 -0
  187. package/.claude/skills/sprint-plan/SKILL.md +14 -0
  188. package/.claude/skills/sprite-editor/SKILL.md +66 -0
  189. package/.claude/skills/sprite-editor/references/api_reference.md +151 -0
  190. package/.claude/skills/sprite-editor/references/background.md +112 -0
  191. package/.claude/skills/sprite-editor/references/templates.md +72 -0
  192. package/.claude/skills/sprite-editor/scripts/AutomaticSliceTexture.cs +40 -0
  193. package/.claude/skills/sprite-editor/scripts/GenerateNewSpriteRects.cs +200 -0
  194. package/.claude/skills/sprite-editor/scripts/GetTextureSourceImageSize.cs +32 -0
  195. package/.claude/skills/sprite-editor/scripts/GetTextureToSlice.cs +55 -0
  196. package/.claude/skills/sprite-editor/scripts/GridSliceTexture.cs +40 -0
  197. package/.claude/skills/sprite-editor/scripts/IsometricSliceTexture.cs +141 -0
  198. package/.claude/skills/sprite-editor/scripts/README.md +134 -0
  199. package/.claude/skills/sprite-editor/scripts/SetPivotExample.cs +58 -0
  200. package/.claude/skills/sprite-editor/scripts/SpriteToPng.cs +88 -0
  201. package/.claude/skills/status/SKILL.md +16 -0
  202. package/.claude/skills/story-readiness/SKILL.md +14 -0
  203. package/.claude/skills/test/SKILL.md +16 -0
  204. package/.claude/skills/ui/SKILL.md +142 -0
  205. package/.claude/skills/ui-imgui/SKILL.md +186 -0
  206. package/.claude/skills/ui-imgui/references/gui-elements.md +156 -0
  207. package/.claude/skills/ui-imgui/references/templates.md +141 -0
  208. package/.claude/skills/ui-review/SKILL.md +14 -0
  209. package/.claude/skills/ui-ugui/SKILL.md +282 -0
  210. package/.claude/skills/ui-ugui/references/scrollview-setup.md +29 -0
  211. package/.claude/skills/ui-uitk/SKILL.md +235 -0
  212. package/.claude/skills/ui-uitk/references/common-issues.md +74 -0
  213. package/.claude/skills/ui-uitk/references/custom-elements.md +241 -0
  214. package/.claude/skills/ui-uitk/references/painter2d.md +282 -0
  215. package/.claude/skills/ui-uitk/references/pointermanipulator-guide.md +94 -0
  216. package/.claude/skills/ui-uitk/references/svg-icons.md +136 -0
  217. package/.claude/skills/ui-uitk/references/ui-runtime-binding.md +234 -0
  218. package/.claude/skills/ui-uitk/references/uss-guide.md +138 -0
  219. package/.claude/skills/unity-cli/CHANGELOG.md +233 -0
  220. package/.claude/skills/unity-cli/SECURITY.md +22 -0
  221. package/.claude/skills/unity-cli/SKILL.md +414 -0
  222. package/.claude/skills/unity-cli/references/auth-license-cloud.md +146 -0
  223. package/.claude/skills/unity-cli/references/build-run-test.md +349 -0
  224. package/.claude/skills/unity-cli/references/collaboration.md +472 -0
  225. package/.claude/skills/unity-cli/references/config-hub.md +103 -0
  226. package/.claude/skills/unity-cli/references/diagnostics-maintenance.md +326 -0
  227. package/.claude/skills/unity-cli/references/editors-install.md +327 -0
  228. package/.claude/skills/unity-cli/references/integration-advanced.md +472 -0
  229. package/.claude/skills/unity-cli/references/projects-templates.md +574 -0
  230. package/.claude/skills/unity-package-management/SKILL.md +304 -0
  231. package/.claude/skills/unity-package-management/references/select-packages.md +108 -0
  232. package/.claude/skills/urp-postprocessing/SKILL.md +188 -0
  233. package/.claude/skills/urp-postprocessing/references/code-templates.md +119 -0
  234. package/.claude/skills/urp-postprocessing/references/effect-reference.md +86 -0
  235. package/.claude/skills/validate-urp-render-graph-renderer-feature/SKILL.md +269 -0
  236. package/.claude/skills/work/SKILL.md +36 -0
  237. package/.claude/skills/work/references/classification.md +41 -0
  238. package/.claude/skills/work/references/closure.md +50 -0
  239. package/.claude/skills/work/references/feature-contracts.md +32 -0
  240. package/.claude/skills/work/references/verification.md +26 -0
  241. package/CLAUDE.md +6 -0
  242. package/LICENSE +21 -0
  243. package/README.md +162 -0
  244. package/THIRD_PARTY_NOTICES.md +23 -0
  245. package/UPGRADING.md +32 -0
  246. package/VERSION +1 -0
  247. package/docs/ARCHITECTURE.md +73 -0
  248. package/docs/HUONG-DAN-MIGRATE-VA-SU-DUNG.md +324 -0
  249. package/docs/MIGRATION-MATRIX.md +23 -0
  250. package/docs/PROJECT-POLICY.md +67 -0
  251. package/docs/WORKFLOWS.md +61 -0
  252. package/package-assets/setup-vivox-voice-chat-evals.gitignore +7 -0
  253. package/package.json +41 -0
  254. package/scaffold/.nccgs/bugs/.gitkeep +1 -0
  255. package/scaffold/.nccgs/closures/.gitkeep +1 -0
  256. package/scaffold/.nccgs/context/.gitkeep +1 -0
  257. package/scaffold/.nccgs/decisions/.gitkeep +1 -0
  258. package/scaffold/.nccgs/evidence/.gitkeep +1 -0
  259. package/scaffold/.nccgs/features/.gitkeep +1 -0
  260. package/scaffold/.nccgs/migrations/.gitkeep +1 -0
  261. package/scaffold/.nccgs/playtests/.gitkeep +1 -0
  262. package/scaffold/.nccgs/project.yaml +103 -0
  263. package/scaffold/.nccgs/requirements.yaml +10 -0
  264. package/scaffold/.nccgs/reviews/.gitkeep +1 -0
  265. package/scaffold/.nccgs/state.md +40 -0
  266. package/scaffold/.nccgs/templates/agent-handoff.md +25 -0
  267. package/scaffold/.nccgs/templates/architecture-decision.md +27 -0
  268. package/scaffold/.nccgs/templates/closure-record.md +51 -0
  269. package/scaffold/.nccgs/templates/context-packet.yaml +17 -0
  270. package/scaffold/.nccgs/templates/evidence-record.md +23 -0
  271. package/scaffold/.nccgs/templates/feature-contract.md +35 -0
  272. package/scaffold/.nccgs/templates/migration-plan.md +40 -0
  273. package/scaffold/.nccgs/templates/waiver.md +11 -0
  274. package/scripts/cli.mjs +56 -0
  275. package/scripts/install.mjs +267 -0
  276. package/scripts/sync-unity-skills.mjs +126 -0
  277. package/scripts/validate.mjs +205 -0
  278. package/tests/framework.test.mjs +121 -0
@@ -0,0 +1,608 @@
1
+ # Privacy and Regulation Settings
2
+
3
+ ## Contents
4
+ - [Overview](#overview)
5
+ - [Quick Reference](#quick-reference)
6
+ - [GDPR Consent Management](#gdpr-consent-management)
7
+ - [CCPA Compliance](#ccpa-compliance)
8
+ - [COPPA Compliance](#coppa-compliance)
9
+ - [Combined Compliance Example](#combined-compliance-example)
10
+ - [Deprecated APIs (SDK 9.3.0 and Lower)](#deprecated-apis-sdk-930-and-lower)
11
+ - [Best Practices](#best-practices)
12
+ - [Testing Privacy Settings](#testing-privacy-settings)
13
+ - [Common Issues](#common-issues)
14
+
15
+ ## Overview
16
+
17
+ > **Note:** This skill provides technical integration guidance, including for LevelPlay's privacy APIs. It is not legal advice, and it does not determine which laws apply to your app — that depends on your users, your data practices, and your distribution. Consult your own legal counsel, and refer to [Regulation Advanced Settings for Unity](https://docs.unity.com/en-us/grow/levelplay/sdk/unity/regulation-advanced-settings) for the authoritative LevelPlay documentation.
18
+
19
+ LevelPlay SDK provides APIs to help facilitate privacy regulation requirements including GDPR, CCPA, and COPPA. These settings must be configured before SDK initialization.
20
+
21
+ **SDK Version Requirement:** SDK 9.4.0+ for current APIs (older deprecated APIs available in SDK 9.3.0 and lower)
22
+
23
+ ## Quick Reference
24
+
25
+ | Regulation | SDK 9.5.0+ API | SDK 9.4.x API | When to Use |
26
+ |------------|---------------|---------------|-------------|
27
+ | **GDPR** | `LevelPlayPrivacySettings.SetGDPRConsent(bool)` | `LevelPlayPrivacySettings.SetGDPRConsents(Dictionary)` | EU users, requires explicit consent |
28
+ | **CCPA** | `LevelPlayPrivacySettings.SetCCPA(true)` | `LevelPlayPrivacySettings.SetCCPA(true)` | California users opting out of data sale |
29
+ | **COPPA** | `LevelPlayPrivacySettings.SetCOPPA(true)` | `LevelPlayPrivacySettings.SetCOPPA(true)` | Apps directed at children under 13 |
30
+
31
+ ## GDPR Consent Management
32
+
33
+ ### What is GDPR?
34
+
35
+ The General Data Protection Regulation (GDPR) is a European Union privacy law requiring explicit user consent for data collection and processing. Apps serving EU users must implement GDPR consent flows.
36
+
37
+ ### Set GDPR Consent
38
+
39
+ The GDPR consent API changed between SDK versions. Check your installed SDK version in **Ads Mediation > Network Manager**.
40
+
41
+ **SDK 9.5.0+ — global consent boolean:**
42
+
43
+ ```csharp
44
+ using Unity.Services.LevelPlay;
45
+
46
+ // true = user has granted consent, false = user has not consented
47
+ // Call BEFORE SDK initialization
48
+ LevelPlayPrivacySettings.SetGDPRConsent(true);
49
+ ```
50
+
51
+ **Parameters:**
52
+ - `true`: User has granted consent for data collection across all networks
53
+ - `false`: User has denied consent (non-personalized ads only)
54
+
55
+ **SDK 9.4.x — per-network consent dictionary:**
56
+
57
+ ```csharp
58
+ using Unity.Services.LevelPlay;
59
+ using System.Collections.Generic;
60
+
61
+ // Set consent for each installed ad network
62
+ // Call BEFORE SDK initialization
63
+ LevelPlayPrivacySettings.SetGDPRConsents(new Dictionary<string, bool> {
64
+ { "UnityAds", true },
65
+ { "IronSource", true }
66
+ // Add an entry for each network you have installed — see Supported Network Keys below
67
+ });
68
+ ```
69
+
70
+ **Important:**
71
+ - Call **BEFORE** `LevelPlay.Init()`
72
+ - `SetGDPRConsent(bool)` (singular) was introduced in SDK 9.5.0. If you are on SDK 9.4.x, use `SetGDPRConsents(Dictionary)` instead.
73
+ - `SetGDPRConsents(Dictionary)` is deprecated as of SDK 9.5.0+ — migrate to `SetGDPRConsent(bool)` when you upgrade.
74
+
75
+ ### Supported Network Keys (for SetGDPRConsents)
76
+
77
+ | Network Key | Ad Network |
78
+ |-------------|------------|
79
+ | `UnityAds` | Unity Ads |
80
+ | `AdMob` | Google AdMob |
81
+ | `AppLovin` | AppLovin |
82
+ | `APS` | Amazon Publisher Services |
83
+ | `BidMachine` | BidMachine |
84
+ | `Bigo` | Bigo Ads |
85
+ | `Chartboost` | Chartboost |
86
+ | `Facebook` | Meta Audience Network |
87
+ | `Fyber` | Digital Turbine (Fyber) |
88
+ | `HyprMx` | HyprMX |
89
+ | `InMobi` | InMobi |
90
+ | `Line` | LINE Ads |
91
+ | `Mintegral` | Mintegral |
92
+ | `MobileFuse` | MobileFuse |
93
+ | `Moloco` | Moloco |
94
+ | `MyTarget` | myTarget |
95
+ | `Ogury` | Ogury |
96
+ | `Pangle` | Pangle (TikTok) |
97
+ | `PubMatic` | PubMatic |
98
+ | `Smaato` | Smaato |
99
+ | `SuperAwesome` | SuperAwesome |
100
+ | `Verve` | Verve |
101
+ | `Voodoo` | Voodoo |
102
+ | `Vungle` | Vungle |
103
+ | `Yandex` | Yandex Ads |
104
+ | `YSO` | YSO |
105
+
106
+ ### Complete GDPR Implementation Example
107
+
108
+ ```csharp
109
+ using UnityEngine;
110
+ using Unity.Services.LevelPlay;
111
+
112
+ public class GDPRConsentManager : MonoBehaviour
113
+ {
114
+ [SerializeField] private string appKey;
115
+
116
+ void Start()
117
+ {
118
+ // Check if user is in GDPR region (EU)
119
+ if (IsUserInGDPRRegion())
120
+ {
121
+ // Show consent dialog and get user's answer
122
+ ShowConsentDialog();
123
+ }
124
+ else
125
+ {
126
+ // Not in GDPR region, initialize normally
127
+ InitializeLevelPlay();
128
+ }
129
+ }
130
+
131
+ private bool IsUserInGDPRRegion()
132
+ {
133
+ // Implement your region detection logic
134
+ // Options: IP geolocation, device locale, or third-party consent SDK
135
+ return false; // Placeholder
136
+ }
137
+
138
+ private void ShowConsentDialog()
139
+ {
140
+ // Show your GDPR consent UI
141
+ // When user makes a choice, call OnConsentReceived()
142
+ }
143
+
144
+ private void OnConsentReceived(bool userConsented)
145
+ {
146
+ // Store consent for future sessions
147
+ PlayerPrefs.SetInt("GDPR_Consent", userConsented ? 1 : 0);
148
+ PlayerPrefs.Save();
149
+
150
+ // Apply consent to LevelPlay (BEFORE Init)
151
+ LevelPlayPrivacySettings.SetGDPRConsent(userConsented);
152
+
153
+ // Initialize SDK
154
+ InitializeLevelPlay();
155
+ }
156
+
157
+ private void InitializeLevelPlay()
158
+ {
159
+ LevelPlay.OnInitSuccess += OnInitSuccess;
160
+ LevelPlay.OnInitFailed += OnInitFailed;
161
+ LevelPlay.Init(appKey);
162
+ }
163
+
164
+ private void OnInitSuccess(LevelPlayConfiguration config)
165
+ {
166
+ Debug.Log("LevelPlay initialized with GDPR consent applied");
167
+ }
168
+
169
+ private void OnInitFailed(LevelPlayInitError error)
170
+ {
171
+ Debug.LogError($"LevelPlay init failed: {error.ErrorMessage}");
172
+ }
173
+ }
174
+ ```
175
+
176
+ ### Updating Consent
177
+
178
+ If user changes consent preferences after initialization:
179
+
180
+ ```csharp
181
+ // User updates consent — apply immediately
182
+ LevelPlayPrivacySettings.SetGDPRConsent(false); // User revoked consent
183
+
184
+ // Note: Changes apply to future ad requests
185
+ // Currently loaded ads are not affected
186
+ ```
187
+
188
+ ---
189
+
190
+ ## CCPA Compliance
191
+
192
+ ### What is CCPA?
193
+
194
+ The California Consumer Privacy Act (CCPA) gives California residents the right to opt out of the "sale" of their personal information. Apps must provide a "Do Not Sell My Personal Information" option.
195
+
196
+ ### Set CCPA Opt-Out (SDK 9.4.0+)
197
+
198
+ Indicate that the user has opted out of data sale:
199
+
200
+ ```csharp
201
+ using Unity.Services.LevelPlay;
202
+
203
+ // User has opted out of data sale (call BEFORE SDK initialization)
204
+ LevelPlayPrivacySettings.SetCCPA(true);
205
+ ```
206
+
207
+ **Parameters:**
208
+ - `true`: User has opted out of data sale (restrict data collection)
209
+ - `false`: User has not opted out (default behavior)
210
+
211
+ **When to call:** BEFORE `LevelPlay.Init()`
212
+
213
+ ### Complete CCPA Implementation Example
214
+
215
+ ```csharp
216
+ using UnityEngine;
217
+ using Unity.Services.LevelPlay;
218
+
219
+ public class CCPAComplianceManager : MonoBehaviour
220
+ {
221
+ [SerializeField] private string appKey;
222
+ private bool userOptedOut = false;
223
+
224
+ void Start()
225
+ {
226
+ // Check if user is in California
227
+ if (IsUserInCalifornia())
228
+ {
229
+ // Load previously saved opt-out preference
230
+ userOptedOut = PlayerPrefs.GetInt("CCPA_OptOut", 0) == 1;
231
+
232
+ // Show "Do Not Sell My Info" option in settings
233
+ // If user hasn't made a choice, you may show a prompt
234
+ }
235
+
236
+ // Apply CCPA setting before initialization
237
+ if (userOptedOut)
238
+ {
239
+ LevelPlayPrivacySettings.SetCCPA(true);
240
+ }
241
+
242
+ // Initialize SDK
243
+ InitializeLevelPlay();
244
+ }
245
+
246
+ private bool IsUserInCalifornia()
247
+ {
248
+ // Implement your region detection logic
249
+ // Options: IP geolocation, device locale
250
+ return false; // Placeholder
251
+ }
252
+
253
+ // Call this when user toggles "Do Not Sell" in settings
254
+ public void OnUserToggleCCPAOptOut(bool optOut)
255
+ {
256
+ userOptedOut = optOut;
257
+
258
+ // Save preference
259
+ PlayerPrefs.SetInt("CCPA_OptOut", optOut ? 1 : 0);
260
+ PlayerPrefs.Save();
261
+
262
+ // Apply to SDK
263
+ LevelPlayPrivacySettings.SetCCPA(optOut);
264
+
265
+ Debug.Log($"CCPA opt-out set to: {optOut}");
266
+ }
267
+
268
+ private void InitializeLevelPlay()
269
+ {
270
+ LevelPlay.OnInitSuccess += OnInitSuccess;
271
+ LevelPlay.OnInitFailed += OnInitFailed;
272
+ LevelPlay.Init(appKey);
273
+ }
274
+
275
+ private void OnInitSuccess(LevelPlayConfiguration config)
276
+ {
277
+ Debug.Log("LevelPlay initialized with CCPA settings applied");
278
+ }
279
+
280
+ private void OnInitFailed(LevelPlayInitError error)
281
+ {
282
+ Debug.LogError($"LevelPlay init failed: {error.ErrorMessage}");
283
+ }
284
+ }
285
+ ```
286
+
287
+ ---
288
+
289
+ ## COPPA Compliance
290
+
291
+ ### What is COPPA?
292
+
293
+ The Children's Online Privacy Protection Act (COPPA) is a US federal law protecting children under 13. Apps directed at children must not collect personal information without parental consent.
294
+
295
+ ### Set Child-Directed Treatment (SDK 9.4.0+)
296
+
297
+ Indicate that your app is directed at children:
298
+
299
+ ```csharp
300
+ using Unity.Services.LevelPlay;
301
+
302
+ // App is directed at children under 13 (call BEFORE SDK initialization)
303
+ LevelPlayPrivacySettings.SetCOPPA(true);
304
+ ```
305
+
306
+ **Parameters:**
307
+ - `true`: App is child-directed, apply COPPA restrictions
308
+ - `false`: App is not child-directed (default)
309
+
310
+ **When to call:** BEFORE `LevelPlay.Init()`
311
+
312
+ ### COPPA Implementation Example
313
+
314
+ ```csharp
315
+ using UnityEngine;
316
+ using Unity.Services.LevelPlay;
317
+
318
+ public class COPPACompliantInitializer : MonoBehaviour
319
+ {
320
+ [SerializeField] private string appKey;
321
+ [SerializeField] private bool isChildDirectedApp = true; // Set this based on your app
322
+
323
+ void Start()
324
+ {
325
+ // Set COPPA compliance BEFORE initialization
326
+ if (isChildDirectedApp)
327
+ {
328
+ LevelPlayPrivacySettings.SetCOPPA(true);
329
+ Debug.Log("COPPA child-directed treatment enabled");
330
+ }
331
+
332
+ // Initialize SDK
333
+ LevelPlay.OnInitSuccess += OnInitSuccess;
334
+ LevelPlay.OnInitFailed += OnInitFailed;
335
+ LevelPlay.Init(appKey);
336
+ }
337
+
338
+ private void OnInitSuccess(LevelPlayConfiguration config)
339
+ {
340
+ Debug.Log("LevelPlay initialized with COPPA compliance");
341
+ }
342
+
343
+ private void OnInitFailed(LevelPlayInitError error)
344
+ {
345
+ Debug.LogError($"LevelPlay init failed: {error.ErrorMessage}");
346
+ }
347
+ }
348
+ ```
349
+
350
+ ### Additional COPPA Considerations
351
+
352
+ If your app is child-directed:
353
+
354
+ 1. **Disable personalized ads**: COPPA requires non-personalized ads only
355
+ 2. **Google Play Families Policy**: If targeting children on Google Play:
356
+ - Set COPPA flag: `LevelPlayPrivacySettings.SetCOPPA(true)`
357
+ - Review Google Play Families requirements for child-directed apps
358
+ - Test thoroughly before submission
359
+ 3. **App Store age ratings**: Set appropriate age ratings in both app stores
360
+ 4. **Privacy policy**: Clearly state data collection practices for children
361
+
362
+ ---
363
+
364
+ ## Combined Compliance Example
365
+
366
+ If you need to support multiple regulations:
367
+
368
+ ```csharp
369
+ using UnityEngine;
370
+ using Unity.Services.LevelPlay;
371
+ using System.Collections.Generic;
372
+
373
+ public class PrivacyComplianceManager : MonoBehaviour
374
+ {
375
+ [SerializeField] private string appKey;
376
+ [SerializeField] private bool isChildDirectedApp = false;
377
+
378
+ void Start()
379
+ {
380
+ // Apply all applicable privacy settings BEFORE initialization
381
+
382
+ // 1. COPPA (if child-directed app)
383
+ if (isChildDirectedApp)
384
+ {
385
+ LevelPlayPrivacySettings.SetCOPPA(true);
386
+ }
387
+
388
+ // 2. GDPR (if user in EU)
389
+ if (IsUserInGDPRRegion())
390
+ {
391
+ if (HasStoredGDPRConsent())
392
+ {
393
+ LevelPlayPrivacySettings.SetGDPRConsent(LoadGDPRConsent());
394
+ }
395
+ else
396
+ {
397
+ // Show consent dialog first, then initialize
398
+ ShowGDPRConsentDialog();
399
+ return; // Don't initialize yet
400
+ }
401
+ }
402
+
403
+ // 3. CCPA (if user in California)
404
+ if (IsUserInCalifornia())
405
+ {
406
+ bool ccpaOptOut = LoadCCPAOptOut();
407
+ if (ccpaOptOut)
408
+ {
409
+ LevelPlayPrivacySettings.SetCCPA(true);
410
+ }
411
+ }
412
+
413
+ // Initialize after applying all privacy settings
414
+ InitializeLevelPlay();
415
+ }
416
+
417
+ private bool HasStoredGDPRConsent()
418
+ {
419
+ return PlayerPrefs.HasKey("GDPR_Consent");
420
+ }
421
+
422
+ private bool LoadGDPRConsent()
423
+ {
424
+ return PlayerPrefs.GetInt("GDPR_Consent", 0) == 1;
425
+ }
426
+
427
+ private bool LoadCCPAOptOut()
428
+ {
429
+ return PlayerPrefs.GetInt("CCPA_OptOut", 0) == 1;
430
+ }
431
+
432
+ private bool IsUserInGDPRRegion()
433
+ {
434
+ // Implement region detection
435
+ return false;
436
+ }
437
+
438
+ private bool IsUserInCalifornia()
439
+ {
440
+ // Implement region detection
441
+ return false;
442
+ }
443
+
444
+ private void ShowGDPRConsentDialog()
445
+ {
446
+ // Show your consent UI, then call OnGDPRConsentReceived()
447
+ }
448
+
449
+ private void OnGDPRConsentReceived(bool userConsented)
450
+ {
451
+ PlayerPrefs.SetInt("GDPR_Consent", userConsented ? 1 : 0);
452
+ PlayerPrefs.Save();
453
+ LevelPlayPrivacySettings.SetGDPRConsent(userConsented);
454
+ InitializeLevelPlay();
455
+ }
456
+
457
+ private void InitializeLevelPlay()
458
+ {
459
+ LevelPlay.OnInitSuccess += OnInitSuccess;
460
+ LevelPlay.OnInitFailed += OnInitFailed;
461
+ LevelPlay.Init(appKey);
462
+ }
463
+
464
+ private void OnInitSuccess(LevelPlayConfiguration config)
465
+ {
466
+ Debug.Log("LevelPlay initialized with privacy compliance");
467
+ }
468
+
469
+ private void OnInitFailed(LevelPlayInitError error)
470
+ {
471
+ Debug.LogError($"LevelPlay init failed: {error.ErrorMessage}");
472
+ }
473
+ }
474
+ ```
475
+
476
+ ---
477
+
478
+ ## Deprecated APIs (SDK 9.3.0 and Lower)
479
+
480
+ **⚠ These APIs are deprecated. Use the current `LevelPlayPrivacySettings` APIs instead.**
481
+
482
+ ### Deprecated GDPR API — LevelPlay.SetConsent
483
+
484
+ ```csharp
485
+ // DEPRECATED - Do not use
486
+ LevelPlay.SetConsent(true); // Grants consent for all networks
487
+ LevelPlay.SetConsent(false); // Denies consent for all networks
488
+ ```
489
+
490
+ **Status:** Marked as `[Obsolete]` in SDK code.
491
+
492
+ **Migration:** Use `LevelPlayPrivacySettings.SetGDPRConsents(Dictionary)` (SDK 9.4.x) or `LevelPlayPrivacySettings.SetGDPRConsent(bool)` (SDK 9.5.0+).
493
+
494
+ ### Deprecated GDPR API — SetGDPRConsents (per-network dictionary, SDK 9.5.0+)
495
+
496
+ ```csharp
497
+ // DEPRECATED as of SDK 9.5.0+ — generates compiler warning
498
+ // NOTE: This is the CORRECT API for SDK 9.4.x. Only deprecated from 9.5.0 onwards.
499
+ Dictionary<string, bool> consents = new Dictionary<string, bool>
500
+ {
501
+ { "UnityAds", true },
502
+ { "AdMob", true }
503
+ };
504
+ LevelPlayPrivacySettings.SetGDPRConsents(consents);
505
+ ```
506
+
507
+ **Note:** `SetGDPRConsents(Dictionary)` is the correct API for SDK 9.4.x. It becomes deprecated only in SDK 9.5.0+, where it is replaced by `SetGDPRConsent(bool)`. If you are on 9.5.0+, migrate to the boolean API.
508
+
509
+ **Migration (9.5.0+ only):** Use `LevelPlayPrivacySettings.SetGDPRConsent(true/false)` instead.
510
+
511
+ ### Deprecated CCPA API
512
+
513
+ ```csharp
514
+ // DEPRECATED - Do not use
515
+ LevelPlay.SetMetaData("do_not_sell", "true");
516
+ LevelPlay.SetMetaData("do_not_sell", "false");
517
+ ```
518
+
519
+ **Migration:** Use `LevelPlayPrivacySettings.SetCCPA(true)` instead.
520
+
521
+ ### Deprecated COPPA API
522
+
523
+ ```csharp
524
+ // DEPRECATED - Do not use
525
+ LevelPlay.SetMetaData("is_child_directed", "true");
526
+ LevelPlay.SetMetaData("is_child_directed", "false");
527
+ ```
528
+
529
+ **Migration:** Use `LevelPlayPrivacySettings.SetCOPPA(true)` instead.
530
+
531
+ ---
532
+
533
+ ## Best Practices
534
+
535
+ 1. **Call before initialization**: All privacy settings must be applied before `LevelPlay.Init()`
536
+ 2. **Persist user choices**: Store consent preferences and reapply on each app launch
537
+ 3. **Detect user region**: Use geolocation or device locale to determine applicable regulations
538
+ 4. **Provide UI controls**: Give users easy access to privacy settings
539
+ 5. **Respect user choices**: Honor opt-outs and consent denials
540
+ 6. **Update promptly**: When user changes preferences, apply immediately via privacy APIs
541
+ 7. **Test thoroughly**: Test your privacy settings in all supported regions
542
+ 8. **Document clearly**: Include privacy policy links in your app
543
+ 9. **Use consent management platforms**: Consider third-party CMPs for complex consent requirements
544
+ 10. **Stay updated**: Privacy regulations evolve, monitor SDK updates for compliance changes
545
+
546
+ ---
547
+
548
+ ## Testing Privacy Settings
549
+
550
+ ### Verify Settings Are Applied
551
+
552
+ ```csharp
553
+ void Start()
554
+ {
555
+ // Set privacy settings
556
+ LevelPlayPrivacySettings.SetCOPPA(true);
557
+ LevelPlayPrivacySettings.SetGDPRConsent(true); // true = user consented
558
+ LevelPlayPrivacySettings.SetCCPA(true);
559
+
560
+ // Initialize
561
+ LevelPlay.OnInitSuccess += OnInitSuccess;
562
+ LevelPlay.Init(appKey);
563
+ }
564
+
565
+ private void OnInitSuccess(LevelPlayConfiguration config)
566
+ {
567
+ Debug.Log("Privacy settings applied successfully");
568
+ // Check console logs from SDK for confirmation
569
+ }
570
+ ```
571
+
572
+ ### Test Scenarios
573
+
574
+ 1. **GDPR - All consents granted**: Set all network consents to `true`, verify ads load
575
+ 2. **GDPR - All consents denied**: Set all network consents to `false`, verify limited ads
576
+ 3. **CCPA opt-out**: Set `SetCCPA(true)`, verify data collection restricted
577
+ 4. **COPPA enabled**: Set `SetCOPPA(true)`, verify child-safe ad delivery
578
+ 5. **Combined**: Apply multiple regulations, verify all honored
579
+
580
+ ---
581
+
582
+ ## Common Issues
583
+
584
+ ### Issue: Privacy settings not taking effect
585
+
586
+ **Causes:**
587
+ - Privacy APIs called after SDK initialization
588
+ - Settings not persisted across app launches
589
+
590
+ **Solutions:**
591
+ - Always call privacy APIs BEFORE `LevelPlay.Init()`
592
+ - Store user preferences and reapply on every launch
593
+
594
+ ### Issue: Using deprecated APIs
595
+
596
+ **Cause:** Following outdated documentation or examples using `LevelPlay.SetConsent()` or `SetGDPRConsents(Dictionary)`
597
+
598
+ **Solution:** Migrate to current APIs — use `LevelPlayPrivacySettings.SetGDPRConsent(bool)` for GDPR
599
+
600
+ ---
601
+
602
+ ## Additional Resources
603
+
604
+ - [LevelPlay Privacy Documentation](https://docs.unity.com/en-us/grow/levelplay)
605
+ - [GDPR Overview](https://gdpr.eu/)
606
+ - [CCPA Information](https://oag.ca.gov/privacy/ccpa)
607
+ - [COPPA Requirements](https://www.ftc.gov/legal-library/browse/rules/childrens-online-privacy-protection-rule-coppa)
608
+ - [Google Play Families Policy](https://support.google.com/googleplay/android-developer/answer/9893335)