From 47860faa97f4bdcb2510a9e824202152b7a110ec Mon Sep 17 00:00:00 2001 From: sotash Date: Thu, 21 May 2026 13:38:53 +0900 Subject: [PATCH 1/4] Update README.md Update README.md --- trivialkart/trivialkart-unity/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/trivialkart/trivialkart-unity/README.md b/trivialkart/trivialkart-unity/README.md index d2610708..2b95e18b 100644 --- a/trivialkart/trivialkart-unity/README.md +++ b/trivialkart/trivialkart-unity/README.md @@ -15,9 +15,9 @@ and Play license status ## Pre-requisites -* Unity 6.0 LTS or higher with Android build support (Play plugins are +* Unity 6.3 LTS or higher with Android build support is recommended (Play plugins are compatible with earlier versions of Unity, but the TrivialKart project is -built using Unity 6.0 LTS) +built using Unity 6000.3.15f1) ### Pre-requsities for enabling Google Play features @@ -57,7 +57,7 @@ available if the subscription is active. 1. Go to the [Google Play Developer Console](https://play.google.com/apps/publish) and create a new application. -2. Navigate to `Monetise with Play -> Monetisation Setup` +2. Navigate to `Monetize with Play -> Monetization setup` Copy the Base64-encoded public key text in the `Licensing` area. You will need to use this key when configuring Unity IAP. @@ -75,7 +75,7 @@ the `Package Name` field. Follow the instructions at [Setting up Unity IAP](https://docs.unity.com/ugs/en-us/manual/iap/manual/get-started) -This sample was tested using version 5.0 of the Unity In App Purchasing +This sample was tested using version 5.3.0 of the Unity In App Purchasing package installed through the Package Manager. We recommend this as a minimum version for this sample. Use of earlier versions, or the older version of Unity IAP available on the Unity Asset Store is not supported. @@ -341,6 +341,8 @@ To fix it, delete the directives under `Edit > Project Settings > Player > Other ## CHANGELOG +2026-05-21: 1.1.2 - Upgraded to Unity 6.3 LTS and com.unity.purchasing 5.3.0. + 2025-09-20: 1.1.1 - Upgraded to Unity 6.0 LTS and PGS v2. 2022-04-01: 1.1.0 - Added Play Games Services, Play Integrity and Google From f8b1e69ddf62ebcf4f5197135c274d28cebde29e Mon Sep 17 00:00:00 2001 From: sotash Date: Fri, 22 May 2026 11:45:08 +0900 Subject: [PATCH 2/4] Update PurchaseController.cs Add UnlockInGameContent and ConfirmPurchase calls on OnPurchasePending to properly acknowledge purchases --- .../Assets/Scripts/Controller/PurchaseController.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/trivialkart/trivialkart-unity/Assets/Scripts/Controller/PurchaseController.cs b/trivialkart/trivialkart-unity/Assets/Scripts/Controller/PurchaseController.cs index 5a36000f..da33b49b 100644 --- a/trivialkart/trivialkart-unity/Assets/Scripts/Controller/PurchaseController.cs +++ b/trivialkart/trivialkart-unity/Assets/Scripts/Controller/PurchaseController.cs @@ -154,6 +154,11 @@ private static void OnPurchaseConfirmed(Order obj) private static void OnPurchasePending(PendingOrder obj) { Debug.Log("Purchase pending " + obj.Info); + foreach (var product in obj.CartOrdered.Items()) + { + GameDataController.UnlockInGameContent(product.Product.definition.id); + } + _storeController.ConfirmPurchase(obj); } private static void FetchProducts() From 8f24027ced085fea36ce80bb2511b4ee7bdd0657 Mon Sep 17 00:00:00 2001 From: sotash Date: Fri, 22 May 2026 12:03:12 +0900 Subject: [PATCH 3/4] Update README.md Update README.md --- trivialkart/trivialkart-unity/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/trivialkart/trivialkart-unity/README.md b/trivialkart/trivialkart-unity/README.md index 2b95e18b..2385f7d1 100644 --- a/trivialkart/trivialkart-unity/README.md +++ b/trivialkart/trivialkart-unity/README.md @@ -322,18 +322,22 @@ You should also disable any lines requesting permissions in your Unity code. See appropriate scripting defines. 5. Create a build using the normal Unity build process. -## Support +## Troubleshooting If you've found any errors or bugs in this sample game, please [file an issue](https://github.com/android/games-samples/issues). -This is not an officially supported Google product. +**Note:** This is not an officially supported Google product. ### Build version workarounds If you forget to select the version you want to build before closing Unity, you may be unable to see the `TrivialKart > BuildOptions` menu. To fix it, delete the directives under `Edit > Project Settings > Player > Other Settings > Script Compilation` and restart Unity. +### If dependency-related errors occur + +If you encounter issues such as dependency-related errors, try `Assets > Reimport All` from the menu bar. + ## Further reading * [Play Games for Unity](https://developer.android.com/games/pgs/unity/unity-start) @@ -341,7 +345,7 @@ To fix it, delete the directives under `Edit > Project Settings > Player > Other ## CHANGELOG -2026-05-21: 1.1.2 - Upgraded to Unity 6.3 LTS and com.unity.purchasing 5.3.0. +2026-05-22: 1.1.2 - Upgraded to Unity 6.3 LTS and com.unity.purchasing 5.3.0 and changed the Support section to Troubleshooting and added content. 2025-09-20: 1.1.1 - Upgraded to Unity 6.0 LTS and PGS v2. From efd6269c184243d700e409778c45cd46431c5cd3 Mon Sep 17 00:00:00 2001 From: sotash Date: Fri, 22 May 2026 12:23:00 +0900 Subject: [PATCH 4/4] Add a null check to PurchaseController.cs Add a null check to PurchaseController.cs --- .../Scripts/Controller/PurchaseController.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/trivialkart/trivialkart-unity/Assets/Scripts/Controller/PurchaseController.cs b/trivialkart/trivialkart-unity/Assets/Scripts/Controller/PurchaseController.cs index da33b49b..b2146bfc 100644 --- a/trivialkart/trivialkart-unity/Assets/Scripts/Controller/PurchaseController.cs +++ b/trivialkart/trivialkart-unity/Assets/Scripts/Controller/PurchaseController.cs @@ -154,11 +154,19 @@ private static void OnPurchaseConfirmed(Order obj) private static void OnPurchasePending(PendingOrder obj) { Debug.Log("Purchase pending " + obj.Info); - foreach (var product in obj.CartOrdered.Items()) + + if (obj.CartOrdered != null) + { + foreach (var product in obj.CartOrdered.Items()) + { + GameDataController.UnlockInGameContent(product.Product.definition.id); + } + _storeController.ConfirmPurchase(obj); + } + else { - GameDataController.UnlockInGameContent(product.Product.definition.id); + Debug.LogWarning("PurchaseController: OnPurchasePending received an order with a null CartOrdered object."); } - _storeController.ConfirmPurchase(obj); } private static void FetchProducts()