コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】GoogleService-Info.plist file missing REVERSED_CLIENT_ID, Google Sign-In will fail to initialize.

概要 GoogleService-Info.plist file missing REVERSED_CLIENT_ID, Google Sign-In will fail to initialize. Firebase 構成ファイル「GoogleService-Info.plist」を Unity プロジェクトに追加して iOS ビルドしたら上記のエラーが発生してビルドに失敗した…

【Unity】iOS の RevenueCat で「The receipt is not valid.」

概要 _makePurchase { "error": { "message": "The receipt is not valid. The purchased product was missing in the receipt. This is typically due to a bug in StoreKit.", "code": 8, "readableErrorCode": "INVALID_RECEIPT", "readable_error_code":…

【Unity】Amazon AppStore の RevenueCat で「There was a problem with the store.」

概要 _receiveProducts { "error": { "code": 2, "message": "There was a problem with the store.", "readableErrorCode": "StoreProblemError", "readable_error_code": "StoreProblemError", "underlyingErrorMessage": "Failed to get user data. Make …

【Unity】Android の RevenueCat で『「XXXX」はすでに定期購入しています。』

概要 _makePurchase { "error": { "code": 6, "message": "This product is already active for the user.", "readableErrorCode": "ProductAlreadyPurchasedError", "readable_error_code": "ProductAlreadyPurchasedError", "underlyingErrorMessage": "Er…

【Unity】Android の RevenueCat で「購入しようとしたアイテムが見つかりませんでした。」

概要 _makePurchase { "error": { "code": 5, "message": "The product is not available for purchase.", "readableErrorCode": "ProductNotAvailableForPurchaseError", "readable_error_code": "ProductNotAvailableForPurchaseError", "underlyingErrorM…

【Unity】iOS の RevenueCat で「There was a problem with the App Store.」

概要 _makePurchase { "error": { "code": 2, "message": "There was a problem with the App Store.", "underlyingErrorMessage": "不明なエラーが起きました", "readableErrorCode": "STORE_PROBLEM", "userCancelled": false, "readable_error_code": "ST…

【Unity】RevenueCat で currencyCode が JPY ではなく USD で送られてきた

概要 "currencyCode": "USD" Apple のサンドボックス環境で RevenueCat を使用して課金の検証をした時に、 Product の currencyCode が JPY ではなく USD で送られてくる現象に遭遇した。 iOS 端末で SANDBOX アカウントでサインインしていないことが原因だ…

Releasing render texture that is set as Camera.targetTexture!

概要 Releasing render texture that is set as Camera.targetTexture! Camera で Render Texture を使用しているシーンから 他のシーンに遷移したら上記のエラーが発生する現象に遭遇した iPhone、Android では発生せず、iPad でのみこのエラーが発生する状…

Windows でも Mac のようなショートカットキーで Delete・Redo できるようにするエディタ拡張

ソースコード

Display クラスで画面の元の解像度を取得する

概要 Screen.SetResolution で画面の解像度を変更した後に、元の解像度を取得したい場合は Display.main.systemWidth と Display.main.systemHeight を参照する 参考サイト様

TimeAPI を使用してサーバーの現在時刻を取得する例

ソースコード 参考サイト様

RevenueCat のエラーコードを列挙型で扱えるようにする

ソースコード

RevenueCat で UniTask を使えるようにする拡張メソッド

ソースコード

Android 端末の「日時を自動的に設定」と「タイムゾーンを自動的に設定」の設定値を取得できるクラス

ソースコード 使用例 using Kogane; using UnityEngine; public class Example : MonoBehaviour { private void Update() { Debug.Log( $"日時を自動的に設定: {AndroidDeviceDateTimeChecker.IsAutoTime}" ); Debug.Log( $"タイムゾーンを自動的に設定: {An…

Firebase 関連のパッケージを 11.8.1 にアップデートした時に遭遇した問題

iOS Android