2022年09月24日

[Unity] Unity2022にバージョンアップしたらURPを更新しろと言われたときの対応

Unity2020→2022 にバージョンアップしてURP(Universal Render Pipeline)を使っているプロジェクトを開いたところ、Unity起動時に「使っているURPをアップグレードしろ」というメッセージが出た。

スクリーンショット20220920.png

対処しないと、URPを使っているシェーダーの色がおかしくなっていた。

以前も似たことがあったので、同じ対応をしたら解決した。

■手順
・Projectウィンドウから、該当するURPファイルを見つけてWクリック(または、シングルクリック > Inspectorウィンドウ > Open Shader Editor)
・Shader Editorの左上メニュー「Save Asset」を押すと、上書きされる

これでシェーダーの色は正常に戻った。
posted by be-style at 22:26| Comment(0) | Unity

2022年09月20日

[Unity] In App Purchasing 4.4.1 にアップデートして出たエラー対応

Unityのパッケージ「In App Purchasing」をPackage Managerを使って、バージョン4.4.1にアップデートしたところ、ビルドエラーが出てしまいました。
その時の対応です。

------------------------------------
Library/PackageCache/com.unity.purchasing@4.4.1/Runtime/SecurityStub/AppleValidator.cs(53,16): error CS0433: The type 'AppleReceipt' exists in both 'Security, Version=1.0.7268.24073, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
------------------------------------

■対応
・Unityを終了
・Finderから、Unityプロジェクト/Library/PackageCache の中身をすべて削除
・Unityを起動

すると、別のエラーが出ました。

------------------------------------
Library/PackageCache/com.unity.purchasing@4.4.1/Runtime/SecurityStub/CrossPlatformValidator.cs(43,16): error CS0433: The type 'IPurchaseReceipt' exists in both 'Security, Version=1.0.7268.24073, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Purchasing.SecurityCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
------------------------------------

変数「Security」の宣言が重複してるのかな?

■対応
・Unityを終了
・Finderから、2つのディレクトリを削除
 →Unityプロジェクト/Plugins > UnityChannel
 →Unityプロジェクト/Plugins > UnityPurchasing
・Unityを起動し、Package Manager で「In App Purchasing」を remove -> install
※参考 : https://teratail.com/questions/167808

今度は、プログラムの内容についてのエラーが出た。

------------------------------------
error CS1061: 'IGooglePlayConfiguration' does not contain a definition for 'SetPublicKey' and no accessible extension method 'SetPublicKey' accepting a first argument of type 'IGooglePlayConfiguration' could be found (are you missing a using directive or an assembly reference?)
------------------------------------

■対応
・SetPublicKeyの箇所をコメントアウト。
(「In App Purchasing 2.2.0」から、SetPublicKeyは廃止になったらしい)
※参考 : https://forum.unity.com/threads/alternative-to-setpublickey.1092364/

これでビルドエラーが消えた。
後でテストしてみよう。
posted by be-style at 17:00| Comment(0) | Unity

2022年09月18日

[iOS] 100マス計算に新しく「おまけ」が追加されました!

iOS版100マス計算に大きなアップデートがされました。
新しく「おまけ」が追加されました!

第一弾は「10をつくろう」です。

ScreenShot20220918.png

数値と演算子を使って10になるような式を作ります。
「( )」を使わないパターンをすべて洗い出したはずですが、抜けがないか今からどきどきしています。
プログラムにない回答パターンで回答された場合は、ちゃんと報告をお願いする仕組みも入れました。

興味のある方は、ぜひ試してみてくださいー。

App Store:
https://apps.apple.com/jp/app/id534131439
posted by be-style at 11:53| Comment(0) | NEWS