391 Views
February 12, 26
スライド概要
リアルタイム3Dコンテンツを制作・運用するための世界的にリードするプラットフォームである「Unity」の日本国内における販売、サポート、コミュニティ活動、研究開発、教育支援を行っています。ゲーム開発者からアーティスト、建築家、自動車デザイナー、映画製作者など、さまざまなクリエイターがUnityを使い想像力を発揮しています。
Platform Toolkit による プラットフォーム機能の 抽象化
発表タイトル Thom Hopper スタッフテクニカルプロダクトマネージャー/クロスプラットフォーム担当
発表タイトル Roman Osipov シニアソフトウェアエンジニア/クロスプラットフォーム担当
概要 アジェンダ 機能 ツール コード
それは何か?
プラットフォームシステムと サービス 機能 ⎯ プラットフォームに固有 ⎯ オンラインサービスと相互作用する ⎯ プラットフォーム SDK が必要 ⎯ 複数のプラットフォームでサポートされない “gamer work space concept” - ekkaphan - stock.adobe.com - 2019
解決しようとしている問題 プラットフォームシステムとサービスの 正しい取り扱いが認定の要件 一部のプラットフォームでのリリースには 認定が必要 リリースには一部のプラットフォーム システムが必要 “gamer work space concept” - ekkaphan - stock.adobe.com - 2019
永続的なデータパス ゲームを保存しています…
永続的なデータパス ゲームを保存しています… “wall of post- ” - GPT IMAGE 1 - 2025
永続的なデータパス ゲームを保存しています… “A girl is a gamer” - Anton - stock.adobe.com 2018
Platform Toolkit 使いやすい非同期 API 多くのプラットフォームをサポート エディター内で成功と失敗をテスト クロスプラットフォーム API プラットフォームのサポート エディターツール 一般的なプラットフォーム関連のタスクを 解決するために使用する、単一の非同期 API 機能をさまざまなプラットフォームで使用でき るようにする一連のプラットフォームサポート パッケージ サポートされている機能をエディターで テストできるようにするエディターツール スイート
Unity のミッション サポートされているユースケースで条件付きコンパイルを不要にする プラットフォーム認定に準拠する サポートされている機能をエディターでテストできるようにする
サポートされる成果 クロスプラットフォームの必須機能 シングルプレイヤー ローカルマルチプレイヤー “A girl is a gamer” - Anton - stock.adobe.com 2018
検証 複数のテストゲーム 定期的な統合 初回使用体験 パートナーからのフィードバック 開発者からのフィードバック
機能
Platform Toolkit の機能 Platform Toolkit を構成する 3 つのパーツ ⎯ ランタイム機能 ⎯ エディターツール ⎯ プラットフォームのサポート
プラットフォームのサポート ローンチ時 iOS / Gamekit Windows / GDK Windows / Steam Xbox One Xbox Series X | S
ランタイム機能サポート アカウント (Account) 実績 (Achievement) ストレージ (Storage) コントローラーの所有権 (Controller Ownership) データストア (Data Store) 機能 (Capabilities) 属性 (Attribute)
ランタイム機能サポート アカウント (Account) 実績 (Achievement) ストレージ (Storage) コントローラーの所有権 (Controller Ownership) データストア (Data Store) 機能 (Capabilities) 属性 (Attribute)
ランタイム機能サポート アカウント (Account) 実績 (Achievement) ストレージ (Storage) コントローラーの所有権 (Controller Ownership) データストア (Data Store) 機能 (Capabilities) 属性 (Attribute)
ランタイム機能サポート アカウント (Account) 実績 (Achievement) ストレージ (Storage) コントローラーの所有権 (Controller Ownership) データストア (Data Store) Capabilities (機能) 属性 (Attribute)
ランタイム機能サポート アカウント (Account) 実績 (Achievement) ストレージ (Storage) コントローラーの所有権 (Controller Ownership) データストア (Data Store) Capabilities (機能) 属性 (Attribute)
ランタイム機能サポート (Capabilities) アカウント (Account) 実績 (Achievement) ストレージ (Storage) コントローラーの所有権 (Controller Ownership) データストア (Data Store) Capabilities (機能) 属性 (Attribute)
概要
最も基本的な事項 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 async void Start() { // get ready! }
Platform Toolkit の初期化 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 async void Start() { // initialize Platform Toolkit await PlatformToolkit.Initialize(); }
主要アカウントの確立 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 async void Start() { // initialize Platform Toolkit await PlatformToolkit.Initialize(); } // establish the primary account IAccount account = await PlatformToolkit.Accounts.Primary.Establish();
実績システムの取得 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 async void Start() { // initialize Platform Toolkit await PlatformToolkit.Initialize(); // establish the primary account IAccount account = await PlatformToolkit.Accounts.Primary.Establish(); } // let's get the achievement system IAchievementSystem achievements = await account.GetAchievementSystem();
実績のロック解除 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 async void Start() { // initialize Platform Toolkit await PlatformToolkit.Initialize(); // establish the primary account IAccount account = await PlatformToolkit.Accounts.Primary.Establish(); // let's get the achievement system IAchievementSystem achievements = await account.GetAchievementSystem(); } // unlock our first achievement achievements.Unlock("THE_REAL_PT_STARTS_HERE");
実績のロック解除 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 async void Start() { // initialize Platform Toolkit await PlatformToolkit.Initialize(); // establish the primary account IAccount account = await PlatformToolkit.Accounts.Primary.Establish(); // let's get the achievement system IAchievementSystem achievements = await account.GetAchievementSystem(); } // unlock our first achievement achievements.Unlock("THE_REAL_PT_STARTS_HERE");
なぜ、うまくいかないのか?
エディターツール
内容
Platform Toolkit の設定
PT メニュー
PMC アセットの作成
PMC アセットとは
テストアカウントデータ
再生モード制御
エディターの動作
システム制御/アカウント制御
アカウントの選択
Achievement エディター
ビルドターゲット
“Space nebula” - 2ragon - stock.adobe.com - 2022
詳細
アカウント
アカウント 他のシステムへの入口 プラットフォーム間で大きく異なる 機能が鍵
アカウントの作成 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 try { if (PlatformToolkit.Capabilities.PrimaryAccount) { IAccount account = await PlatformToolkit.Accounts.Primary.Establish(); } } catch (UserRefusalException e) { // User refused to sign in } catch (TemporarilyUnavailableException e) { // Either a network error or sign in limit was exceeded }
アカウントの作成 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 try { if (PlatformToolkit.Capabilities.PrimaryAccount) { IAccount account = await PlatformToolkit.Accounts.Primary.Establish(); } } catch (UserRefusalException e) { // User refused to sign in } catch (TemporarilyUnavailableException e) { // Either a network error or sign in limit was exceeded }
アカウントの作成 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 try { if (PlatformToolkit.Capabilities.PrimaryAccount) { IAccount account = await PlatformToolkit.Accounts.Primary.Establish(); } } catch (UserRefusalException e) { // User refused to sign in } catch (TemporarilyUnavailableException e) { // Either a network error or sign in limit was exceeded }
アカウントの作成 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 try { if (PlatformToolkit.Capabilities.PrimaryAccount) { IAccount account = await PlatformToolkit.Accounts.Primary.Establish(); } } catch (UserRefusalException e) { // User refused to sign in } catch (TemporarilyUnavailableException e) { // Either a network error or sign in limit was exceeded }
追加アカウント 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 try { if (PlatformToolkit.Capabilities.AccountPicker) { IAccount account = await PlatformToolkit.Accounts.Picker.Show(); } } catch (UserRefusalException e) { // User refused to sign in }
追加アカウント 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 try { if (PlatformToolkit.Capabilities.AccountPicker) { IAccount account = await PlatformToolkit.Accounts.Picker.Show(); } } catch (UserRefusalException e) { // User refused to sign in }
追加アカウント 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 try { if (PlatformToolkit.Capabilities.AccountPicker) { IAccount account = await PlatformToolkit.Accounts.Picker.Show(); } } catch (UserRefusalException e) { // User refused to sign in }
属性
属性
属性
属性
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try
{
if (account.HasAttribute<string>("MAIN_MENU_NAME"))
{
string name = await account.GetAttribute<string>("MAIN_MENU_NAME");
nameLabel.style.display = DisplayStyle.Flex;
nameLabel.text = name;
}
else
{
nameLabel.style.display = DisplayStyle.None;
}
}
catch (InvalidAccountException e)
{
// Handle signed out account
}
属性
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try
{
if (account.HasAttribute<string>("MAIN_MENU_NAME"))
{
string name = await account.GetAttribute<string>("MAIN_MENU_NAME");
nameLabel.style.display = DisplayStyle.Flex;
nameLabel.text = name;
}
else
{
nameLabel.style.display = DisplayStyle.None;
}
}
catch (InvalidAccountException e)
{
// Handle signed out account
}
属性
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try
{
if (account.HasAttribute<string>("MAIN_MENU_NAME"))
{
string name = await account.GetAttribute<string>("MAIN_MENU_NAME");
nameLabel.style.display = DisplayStyle.Flex;
nameLabel.text = name;
}
else
{
nameLabel.style.display = DisplayStyle.None;
}
}
catch (InvalidAccountException e)
{
// Handle signed out account
}
属性
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try
{
if (account.HasAttribute<string>("MAIN_MENU_NAME"))
{
string name = await account.GetAttribute<string>("MAIN_MENU_NAME");
nameLabel.style.display = DisplayStyle.Flex;
nameLabel.text = name;
}
else
{
nameLabel.style.display = DisplayStyle.None;
}
}
catch (InvalidAccountException e)
{
// Handle signed out account
}
実績
実績 多くのプラットフォームで必須 だが、常に利用できるわけではない エディターツールが役立つ 実績が見つからない場合の警告
実績の例 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 if (PlatformToolkit.Capabilities.AccountAchievements) { try { IAchievementSystem achievementSystem; achievementSystem = await account.GetAchievementSystem(); achievementSystem.Unlock("EGGCITEMENT"); achievementSystem.UpdateProgress("THIRTY_EGGS", 30); } } catch (InvalidAccountException e) { // Handle signed out account }
実績の例 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 if (PlatformToolkit.Capabilities.AccountAchievements) { try { IAchievementSystem achievementSystem; achievementSystem = await account.GetAchievementSystem(); achievementSystem.Unlock("EGGCITEMENT"); achievementSystem.UpdateProgress("THIRTY_EGGS", 30); } } catch (InvalidAccountException e) { // Handle signed out account }
実績の例 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 if (PlatformToolkit.Capabilities.AccountAchievements) { try { IAchievementSystem achievementSystem; achievementSystem = await account.GetAchievementSystem(); achievementSystem.Unlock("EGGCITEMENT"); achievementSystem.UpdateProgress("THIRTY_EGGS", 30); } } catch (InvalidAccountException e) { // Handle signed out account }
実績の例 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 if (PlatformToolkit.Capabilities.AccountAchievements) { try { IAchievementSystem achievementSystem; achievementSystem = await account.GetAchievementSystem(); achievementSystem.Unlock("EGGCITEMENT"); achievementSystem.UpdateProgress("THIRTY_EGGS", 30); } } catch (InvalidAccountException e) { // Handle signed out account }
入力の所有権
入力の所有権 すべてのプラットフォームで入力デバイスとアカウントが 密に結合されているわけではない 入力システムパッケージが必要
入力の所有権 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 async Task UnlockForPlayer(string achievementId, InputDevice inputDevice) { if (PlatformToolkit.Capabilities.InputOwnership) { IAccount account = PlatformToolkit.Accounts.InputOwnership.GetOwner(inputDevice); } } if (account != null) { IAchievementSystem achievementSystem = await account.GetAchievementSystem(); achievementSystem.Unlock(achievementId); }
入力の所有権 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 async Task UnlockForPlayer(string achievementId, InputDevice inputDevice) { if (PlatformToolkit.Capabilities.InputOwnership) { IAccount account = PlatformToolkit.Accounts.InputOwnership.GetOwner(inputDevice); } } if (account != null) { IAchievementSystem achievementSystem = await account.GetAchievementSystem(); achievementSystem.Unlock(achievementId); }
入力の所有権 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 async Task UnlockForPlayer(string achievementId, InputDevice inputDevice) { if (PlatformToolkit.Capabilities.InputOwnership) { IAccount account = PlatformToolkit.Accounts.InputOwnership.GetOwner(inputDevice); } } if (account != null) { IAchievementSystem achievementSystem = await account.GetAchievementSystem(); achievementSystem.Unlock(achievementId); }
入力の所有権 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 async Task UnlockForPlayer(string achievementId, InputDevice inputDevice) { if (PlatformToolkit.Capabilities.InputOwnership) { IAccount account = PlatformToolkit.Accounts.InputOwnership.GetOwner(inputDevice); } } if (account != null) { IAchievementSystem achievementSystem = await account.GetAchievementSystem(); achievementSystem.Unlock(achievementId); }
保存
保存 シンプルにできる 複雑にできる ルールが多い
システムの取得 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 ISavingSystem savingSystem; if (PlatformToolkit.Capabilities.AccountSaving) { try { savingSystem = await account.GetSavingSystem(); } catch (InvalidAccountException e) { // Handle signed out account } } else if (PlatformToolkit.Capabilities.LocalSaving) { savingSystem = PlatformToolkit.LocalSaving; }
システムの取得 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 ISavingSystem savingSystem; if (PlatformToolkit.Capabilities.AccountSaving) { try { savingSystem = await account.GetSavingSystem(); } catch (InvalidAccountException e) { // Handle signed out account } } else if (PlatformToolkit.Capabilities.LocalSaving) { savingSystem = PlatformToolkit.LocalSaving; }
システムの取得 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 ISavingSystem savingSystem; if (PlatformToolkit.Capabilities.AccountSaving) { try { savingSystem = await account.GetSavingSystem(); } catch (InvalidAccountException e) { // Handle signed out account } } else if (PlatformToolkit.Capabilities.LocalSaving) { savingSystem = PlatformToolkit.LocalSaving; }
ファイルへの書き込み
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
byte[] characterStateData = null, storeStateData = null;
try {
await using ISaveWritable saveWritable =
await savingSystem.OpenSaveWritable("my-save-file");
await saveWritable.WriteFile("character-state", characterStateData);
await saveWritable.WriteFile("store-state", storeStateData);
await saveWritable.Commit();
}
catch (InvalidAccountException e) {
// Handle signed out account
}
catch (NotEnoughSpaceException e) {
// Prompt user that there is not enough space to write a save
}
catch (IOException e) {
// Prompt user that saving has failed
}
ファイルへの書き込み
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
byte[] characterStateData = null, storeStateData = null;
try {
await using ISaveWritable saveWritable =
await savingSystem.OpenSaveWritable("my-save-file");
await saveWritable.WriteFile("character-state", characterStateData);
await saveWritable.WriteFile("store-state", storeStateData);
await saveWritable.Commit();
}
catch (InvalidAccountException e) {
// Handle signed out account
}
catch (NotEnoughSpaceException e) {
// Prompt user that there is not enough space to write a save
}
catch (IOException e) {
// Prompt user that saving has failed
}
ファイルへの書き込み
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
byte[] characterStateData = null, storeStateData = null;
try {
await using ISaveWritable saveWritable =
await savingSystem.OpenSaveWritable("my-save-file");
await saveWritable.WriteFile("character-state", characterStateData);
await saveWritable.WriteFile("store-state", storeStateData);
await saveWritable.Commit();
}
catch (InvalidAccountException e) {
// Handle signed out account
}
catch (NotEnoughSpaceException e) {
// Prompt user that there is not enough space to write a save
}
catch (IOException e) {
// Prompt user that saving has failed
}
ファイルへの書き込み
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
byte[] characterStateData = null, storeStateData = null;
try {
await using ISaveWritable saveWritable =
await savingSystem.OpenSaveWritable("my-save-file");
await saveWritable.WriteFile("character-state", characterStateData);
await saveWritable.WriteFile("store-state", storeStateData);
await saveWritable.Commit();
}
catch (InvalidAccountException e) {
// Handle signed out account
}
catch (NotEnoughSpaceException e) {
// Prompt user that there is not enough space to write a save
}
catch (IOException e) {
// Prompt user that saving has failed
}
ファイルへの書き込み
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
byte[] characterStateData = null, storeStateData = null;
try {
await using ISaveWritable saveWritable =
await savingSystem.OpenSaveWritable("my-save-file");
await saveWritable.WriteFile("character-state", characterStateData);
await saveWritable.WriteFile("store-state", storeStateData);
await saveWritable.Commit();
}
catch (InvalidAccountException e) {
// Handle signed out account
}
catch (NotEnoughSpaceException e) {
// Prompt user that there is not enough space to write a save
}
catch (IOException e) {
// Prompt user that saving has failed
}
ファイルへの書き込み
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
byte[] characterStateData = null, storeStateData = null;
try {
await using ISaveWritable saveWritable =
await savingSystem.OpenSaveWritable("my-save-file");
await saveWritable.WriteFile("character-state", characterStateData);
await saveWritable.WriteFile("store-state", storeStateData);
await saveWritable.Commit();
}
catch (InvalidAccountException e) {
// Handle signed out account
}
catch (NotEnoughSpaceException e) {
// Prompt user that there is not enough space to write a save
}
catch (IOException e) {
// Prompt user that saving has failed
}
保存システムの構造
ファイルの読み取り
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try {
if (!await savingSystem.SaveExists("my-save-file"))
{
// Handle save not existing
}
await using ISaveReadable saveReadable =
await savingSystem.OpenSaveReadable("my-save-file");
byte[] characterStateData = await saveReadable.ReadFile("character-state");
byte[] storeStateData = await saveReadable.ReadFile("store-state");
}
catch (CorruptedSaveException e) {
// Delete the save
}
catch (IOException e) {
// Prompt user that saving has failed
}
ファイルの読み取り
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try {
if (!await savingSystem.SaveExists("my-save-file"))
{
// Handle save not existing
}
await using ISaveReadable saveReadable =
await savingSystem.OpenSaveReadable("my-save-file");
byte[] characterStateData = await saveReadable.ReadFile("character-state");
byte[] storeStateData = await saveReadable.ReadFile("store-state");
}
catch (CorruptedSaveException e) {
// Delete the save
}
catch (IOException e) {
// Prompt user that saving has failed
}
ファイルの読み取り
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try {
if (!await savingSystem.SaveExists("my-save-file"))
{
// Handle save not existing
}
await using ISaveReadable saveReadable =
await savingSystem.OpenSaveReadable("my-save-file");
byte[] characterStateData = await saveReadable.ReadFile("character-state");
byte[] storeStateData = await saveReadable.ReadFile("store-state");
}
catch (CorruptedSaveException e) {
// Delete the save
}
catch (IOException e) {
// Prompt user that saving has failed
}
ファイルの読み取り
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try {
if (!await savingSystem.SaveExists("my-save-file"))
{
// Handle save not existing
}
await using ISaveReadable saveReadable =
await savingSystem.OpenSaveReadable("my-save-file");
byte[] characterStateData = await saveReadable.ReadFile("character-state");
byte[] storeStateData = await saveReadable.ReadFile("store-state");
}
catch (CorruptedSaveException e) {
// Delete the save
}
catch (IOException e) {
// Prompt user that saving has failed
}
ファイルの読み取り
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try {
if (!await savingSystem.SaveExists("my-save-file"))
{
// Handle save not existing
}
await using ISaveReadable saveReadable =
await savingSystem.OpenSaveReadable("my-save-file");
byte[] characterStateData = await saveReadable.ReadFile("character-state");
byte[] storeStateData = await saveReadable.ReadFile("store-state");
}
catch (CorruptedSaveException e) {
// Delete the save
}
catch (IOException e) {
// Prompt user that saving has failed
}
データストア
データストア
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try
{
ISavingSystem savingSystem = await account.GetSavingSystem();
DataStore dataStore = await DataStore.Load(savingSystem, "my-save-1");
dataStore.SetInt("cheese", 99);
dataStore.SetString("alias", "Cool Rat");
catRatio = dataStore.GetFloat("cat-ratio");
await dataStore.Save(savingSystem, "my-save-1");
}
catch (InvalidAccountException e) { /* Handle signed out account */ }
catch (NotEnoughSpaceException e) { /* Handle not enough space to write */ }
catch (CorruptedSaveException e) { /* Handle corrupted save */ }
catch (IOException e) { /* Handle generic IO error */ }
データストア
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try
{
ISavingSystem savingSystem = await account.GetSavingSystem();
DataStore dataStore = await DataStore.Load(savingSystem, "my-save-1");
dataStore.SetInt("cheese", 99);
dataStore.SetString("alias", "Cool Rat");
catRatio = dataStore.GetFloat("cat-ratio");
await dataStore.Save(savingSystem, "my-save-1");
}
catch (InvalidAccountException e) { /* Handle signed out account */ }
catch (NotEnoughSpaceException e) { /* Handle not enough space to write */ }
catch (CorruptedSaveException e) { /* Handle corrupted save */ }
catch (IOException e) { /* Handle generic IO error */ }
データストア
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try
{
ISavingSystem savingSystem = await account.GetSavingSystem();
DataStore dataStore = await DataStore.Load(savingSystem, "my-save-1");
dataStore.SetInt("cheese", 99);
dataStore.SetString("alias", "Cool Rat");
catRatio = dataStore.GetFloat("cat-ratio");
await dataStore.Save(savingSystem, "my-save-1");
}
catch (InvalidAccountException e) { /* Handle signed out account */ }
catch (NotEnoughSpaceException e) { /* Handle not enough space to write */ }
catch (CorruptedSaveException e) { /* Handle corrupted save */ }
catch (IOException e) { /* Handle generic IO error */ }
データストア
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try
{
ISavingSystem savingSystem = await account.GetSavingSystem();
DataStore dataStore = await DataStore.Load(savingSystem, "my-save-1");
dataStore.SetInt("cheese", 99);
dataStore.SetString("alias", "Cool Rat");
catRatio = dataStore.GetFloat("cat-ratio");
await dataStore.Save(savingSystem, "my-save-1");
}
catch (InvalidAccountException e) { /* Handle signed out account */ }
catch (NotEnoughSpaceException e) { /* Handle not enough space to write */ }
catch (CorruptedSaveException e) { /* Handle corrupted save */ }
catch (IOException e) { /* Handle generic IO error */ }
データストア
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
try
{
ISavingSystem savingSystem = await account.GetSavingSystem();
DataStore dataStore = await DataStore.Load(savingSystem, "my-save-1");
dataStore.SetInt("cheese", 99);
dataStore.SetString("alias", "Cool Rat");
catRatio = dataStore.GetFloat("cat-ratio");
await dataStore.Save(savingSystem, "my-save-1");
}
catch (InvalidAccountException e) { /* Handle signed out account */ }
catch (NotEnoughSpaceException e) { /* Handle not enough space to write */ }
catch (CorruptedSaveException e) { /* Handle corrupted save */ }
catch (IOException e) { /* Handle generic IO error */ }
要約 アカウント (Account) 実績 (Achievement) ストレージ (Storage) コントローラーの所有権 (Controller Ownership) データストアア (Data Store) 機能 (Capabilities) 属性 (Attribute)
利点 ハードウェアにデプロイすることなくエディター内でテスト プラットフォーム固有のコードを記述することなく、多くのプラットフォーム向けにビルド 1 つのパッケージをインストールするだけで新しいプラットフォームと統合 より確実に認定に合格
提供時期
ロードマップ プラットフォームのサポート 現在 6.3 LTS iOS / Gamekit Windows / GDK Windows / Steam Xbox One Xbox Series X | S それ以降 要問い合わせ 機能 アカウント アチーブメント/トロフィー ストレージ データストア コントローラーの所有権 機能 (Capabilities) 要問い合わせ
Platform Toolkit 6.3 で使用可能 対象プラットフォームの増加 リスクの軽減 イテレーション時間の改善 認定に合格
ありがとうございました