質問編集履歴
3
HandleRewardBasedVideoClosedのplayerHealth.Death();をコメントアウト
test
CHANGED
File without changes
|
test
CHANGED
@@ -238,9 +238,9 @@
|
|
238
238
|
|
239
239
|
{
|
240
240
|
|
241
|
-
// 追記
|
241
|
+
// 追記→コメントアウト
|
242
|
-
|
242
|
+
|
243
|
-
playerHealth.Death();
|
243
|
+
// playerHealth.Death();
|
244
244
|
|
245
245
|
MonoBehaviour.print ("HandleRewardBasedVideoClosed event received");
|
246
246
|
|
2
UniRx関連のコードを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -54,6 +54,10 @@
|
|
54
54
|
|
55
55
|
using StrOpe = StringOperationUtil.OptimizedStringOperation;
|
56
56
|
|
57
|
+
using UniRx;
|
58
|
+
|
59
|
+
using UniRx.Triggers;
|
60
|
+
|
57
61
|
|
58
62
|
|
59
63
|
public class AdManagement : MonoBehaviour {
|
@@ -78,6 +82,18 @@
|
|
78
82
|
|
79
83
|
RegistHandler ();
|
80
84
|
|
85
|
+
|
86
|
+
|
87
|
+
// 追記
|
88
|
+
|
89
|
+
this.UpdateAsObservable()
|
90
|
+
|
91
|
+
.Where(_ => endPlay)
|
92
|
+
|
93
|
+
.ObserveOnMainThread()
|
94
|
+
|
95
|
+
.Subscribe(_ => playerHealth.Revival());
|
96
|
+
|
81
97
|
}
|
82
98
|
|
83
99
|
|
@@ -200,9 +216,9 @@
|
|
200
216
|
|
201
217
|
{
|
202
218
|
|
203
|
-
//
|
219
|
+
// 追記
|
204
|
-
|
220
|
+
|
205
|
-
|
221
|
+
endPlay = true;
|
206
222
|
|
207
223
|
|
208
224
|
|
@@ -222,6 +238,10 @@
|
|
222
238
|
|
223
239
|
{
|
224
240
|
|
241
|
+
// 追記
|
242
|
+
|
243
|
+
playerHealth.Death();
|
244
|
+
|
225
245
|
MonoBehaviour.print ("HandleRewardBasedVideoClosed event received");
|
226
246
|
|
227
247
|
}
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -261,3 +261,9 @@
|
|
261
261
|
|
262
262
|
|
263
263
|
```
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
###参考にしたエントリ
|
268
|
+
|
269
|
+
[https://stackoverflow.com/questions/37354039/how-to-check-if-an-advertisement-has-finished-in-unity](https://stackoverflow.com/questions/37354039/how-to-check-if-an-advertisement-has-finished-in-unity)
|