現在UnityでfirebaseのRealtime Databaseをつかってグループ作成機能を作りたいと考えています。
そこでgroupが持つusersのkeyとしてuser_idを入れたいのですが、JsonUtilityを使うとkeyが変数名になってしまうため思うようなjsonが作れません。どのようにjsonを作成すればいいでしょうか?
こんな感じのイメージです。
json
1// An index to track Ada's memberships 2{ 3 "users": { 4 "alovelace": { 5 "name": "Ada Lovelace", 6 // Index Ada's groups in her profile 7 "groups": { 8 // the value here doesn't matter, just that the key exists 9 "techpioneers": true, 10 "womentechmakers": true 11 } 12 }, 13 ... 14 }, 15 "groups": { 16 "techpioneers": { 17 "name": "Historical Tech Pioneers", 18 "members": { 19 "alovelace": true, 20 "ghopper": true, 21 "eclarke": true 22 } 23 }, 24 ... 25 } 26}
あなたの回答
tips
プレビュー