質問編集履歴

3

誤字

2020/02/17 12:26

投稿

Aka.H
Aka.H

スコア7

test CHANGED
File without changes
test CHANGED
@@ -23,8 +23,6 @@
23
23
 
24
24
 
25
25
  ###エラーメッセージ
26
-
27
- ①のスクリプト
28
26
 
29
27
  ```
30
28
 

2

質問内容を細かくした

2020/02/17 12:26

投稿

Aka.H
Aka.H

スコア7

test CHANGED
@@ -1 +1 @@
1
- UnityIAP コード記述ほぼ無しで実装方法
1
+ UnityIAPのGooglePlayCSVが書き出せない
test CHANGED
@@ -4,95 +4,99 @@
4
4
 
5
5
  Unityで携帯アプリゲームを製作しています。
6
6
 
7
- ゲーム内で課金のシステムを入れたいのですが上手くいきません。
7
+ 課金のシステムをUnityIAPのコードレスIAPを使用して導してのですが
8
8
 
9
-
10
-
11
- 実装したい課金システムは
12
-
13
- ゲーム内で使用するコインを100枚(100円)、250枚(200円)という風に購入してもらうよくある感じのものです。
14
-
15
- UnityIAP使用してスクリプくやり方や、書かないやり方などいろいろな方法があり理解しれていなくて困っています。
9
+ GooglePlayに課金アイテム情報インポーするためのCSVファイルが書き出せなくて困っています。
16
-
17
-
18
-
19
- システムをちゃんと理解しきれていないので的外れな質問になっていたらすみません。
20
10
 
21
11
 
22
12
 
23
13
  ### 試したこと
24
14
 
25
- IStoreListener実装したクラスリプトを書かなくて出来るという記事があったので試しみたのですが上手くせんでした
15
+ IAP Catalog にはID、Type、Title、Description、Priceを設定済みでUDPも同期させて自動初期化チェックも入れていま
16
+
17
+ Unity上で再生すると購入確認のウィンドウも表示されます(実機テストはできていません)。
26
18
 
27
19
 
28
20
 
29
- やってみたことは
30
-
31
- ゲーム内ショップに設置してある購入ボタンにIAPボタンのコンポーネントを設置、
32
-
33
- IAP Catalogを作成(Automatically initialize UnityPurchasing (recommended)というのにチェック済)
34
-
35
- 普通のボタンと同じようにpublicでクリックしたら実行するスクリプト①をOnPruchaseCompleteにアタッチ設定、
36
-
37
- Unityで実行→購入の有無を聞くウィンドウが無事表示される
38
-
39
- という感じなですが、実機にビルドして購入ボタンを押すと「初期化ができないため購入できません」②とエラーが出ます。
21
+ しかし「AppStoreExport」「GooglePlayCSV」をクリックして書き出そうととエラーが出てしいます。
40
22
 
41
23
 
42
24
 
43
- ### 該当スクリプト・エラーメッセージ
25
+ ###エラーメッセージ
44
26
 
45
27
  ①のスクリプト
46
28
 
47
29
  ```
48
30
 
49
- public class UnityIAP : MonoBehaviour
31
+ OverflowException: Arithmetic operation resulted in an overflow.
50
32
 
51
- {
33
+ System.Convert.ToInt32 (System.Decimal value) (at <437ba245d8404784b9fbab9b439ac908>:0)
52
34
 
53
- public CoinManager coinManager;
35
+ UnityEditor.Purchasing.GooglePlayProductCatalogExporter.PackPrice (UnityEngine.Purchasing.ProductCatalogItem product) (at <9c5a6c83d4ce4fea836412d752fa7e99>:0)
54
36
 
55
- public void CoinBuy_100()
37
+ UnityEditor.Purchasing.GooglePlayProductCatalogExporter.Export (UnityEngine.Purchasing.ProductCatalog catalog) (at <9c5a6c83d4ce4fea836412d752fa7e99>:0)
56
38
 
57
- {
39
+ UnityEditor.Purchasing.ProductCatalogEditor+ProductCatalogExportWindow.ExportHelper (UnityEditor.Purchasing.ProductCatalogEditor+IProductCatalogExporter exporter, System.String path) (at <9c5a6c83d4ce4fea836412d752fa7e99>:0)
58
40
 
59
- coinManager.TotalCoin += 100;
41
+ UnityEditor.Purchasing.ProductCatalogEditor+ProductCatalogExportWindow.Export (UnityEditor.Purchasing.ProductCatalogEditor+IProductCatalogExporter exporter) (at <9c5a6c83d4ce4fea836412d752fa7e99>:0)
60
42
 
61
- Debug.Log("購入成功"+ 100);
43
+ UnityEditor.Purchasing.ProductCatalogEditor+ProductCatalogExportWindow.OnGUI (UnityEngine.Rect rect) (at <9c5a6c83d4ce4fea836412d752fa7e99>:0)
62
44
 
63
- }
45
+ UnityEditor.PopupWindow.OnGUI () (at <0a2a5ea3c8ab4e3394576dd407a984f6>:0)
64
46
 
65
- }
47
+ System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
66
48
 
67
- ```
49
+ Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
68
50
 
69
- ②のエラー
51
+ System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
70
52
 
71
- ```
53
+ System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
72
54
 
73
- I/Unity: IAPButton.PurchaseProduct() with product ID: coin_100
55
+ UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <0a2a5ea3c8ab4e3394576dd407a984f6>:0)
74
56
 
75
- (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
57
+ UnityEditor.HostView.Invoke (System.String methodName) (at <0a2a5ea3c8ab4e3394576dd407a984f6>:0)
76
58
 
77
- E/Unity: Purchase failed because Purchasing was not initialized correctly
59
+ UnityEditor.HostView.OldOnGUI () (at <0a2a5ea3c8ab4e3394576dd407a984f6>:0)
78
60
 
79
- (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
61
+ UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Boolean canAffectFocus) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
80
62
 
81
- I/Unity: IAPButton.OnPurchaseFailed(Product , PurchaseFailureReason PurchasingUnavailable)
63
+ UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean canAffectFocus) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
82
64
 
83
- (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
65
+ UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
66
+
67
+ UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
68
+
69
+ UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
70
+
71
+ UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
72
+
73
+ UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
74
+
75
+ UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
76
+
77
+ UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
78
+
79
+ UnityEngine.UIElements.EventDispatcher.OpenGate () (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
80
+
81
+ UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
82
+
83
+ UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
84
+
85
+ UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
86
+
87
+ UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
88
+
89
+ UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
90
+
91
+ UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <f7c9e0a331b445ba8071b5f2fcbbe99e>:0)
92
+
93
+ UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <59837000ebf54955a9cb1d31caa86097>:0)
94
+
95
+
84
96
 
85
97
 
86
98
 
87
99
  ```
88
-
89
- ### 質問
90
-
91
- PCのUnity上では成功しているということはIStoreListenerを実装したクラスのスクリプトは書かなくても実装可能なのでしょうか?
92
-
93
- それともスマホアプリで実行するにはやはり自分で書かないといけないものなのでしょうか?
94
-
95
- もしそうであれば、マニュアルだといまいち理解しきれなかったので解説していただけると助かります。
96
100
 
97
101
 
98
102
 

1

質問内容を詳しく

2020/02/15 16:21

投稿

Aka.H
Aka.H

スコア7

test CHANGED
@@ -1 +1 @@
1
- スマホアプリに実装したいUnityIAP課金システムが上手くいかない
1
+ UnityIAP コード記述ほぼ無しでの実装方法
test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  ゲーム内で使用するコインを100枚(100円)、250枚(200円)という風に購入してもらうよくある感じのものです。
14
14
 
15
- UnityIAPというのを使ってやるのが簡単だと調べて出てきたのでインポートして使ってみているのですが、スクリプトを書くやり方や、書かないやり方などいろいろな方法があり理解しきれていなくて困っています。
15
+ UnityIAPを使してスクリプトを書くやり方や、書かないやり方などいろいろな方法があり理解しきれていなくて困っています。
16
16
 
17
17
 
18
18
 
@@ -22,7 +22,7 @@
22
22
 
23
23
  ### 試したこと
24
24
 
25
- UnityマニュアルなどでIStoreListenerを実装したクラスのスクリプトを書くというのが出てきたのですが、色々調べると書かなくても出来るという記事り難しそうだったので書かない方で試してみたのですが上手くいきませんでした。
25
+ IStoreListenerを実装したクラスのスクリプトを書かなくても出来るという記事あったので試してみたのですが上手くいきませんでした。
26
26
 
27
27
 
28
28
 
@@ -88,7 +88,9 @@
88
88
 
89
89
  ### 質問
90
90
 
91
+ PCのUnity上では成功しているということはIStoreListenerを実装したクラスのスクリプトは書かなくても実装可能なのでしょうか?
92
+
91
- スマホアプリで実行するにはやはり初期化等のスクリプトは書かないといけないものなのでしょうか?
93
+ それともスマホアプリで実行するにはやはり自分で書かないといけないものなのでしょうか?
92
94
 
93
95
  もしそうであれば、マニュアルだといまいち理解しきれなかったので解説していただけると助かります。
94
96