質問編集履歴
1
修正したスクリプトを記載、タイトルを変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1減るはずが
|
1
|
+
1減るはずが0または-1になる
|
test
CHANGED
@@ -52,7 +52,7 @@
|
|
52
52
|
|
53
53
|
public int heart = 100;
|
54
54
|
|
55
|
-
public int heart2;
|
55
|
+
public int heart2 = 900;
|
56
56
|
|
57
57
|
public AudioClip damageSE;
|
58
58
|
|
@@ -76,7 +76,9 @@
|
|
76
76
|
|
77
77
|
{
|
78
78
|
|
79
|
+
Text.text = "HP: " + 900;
|
80
|
+
|
79
|
-
heart =
|
81
|
+
heart2 = PlayerPrefs.GetInt("level");
|
80
82
|
|
81
83
|
aud = GetComponent<AudioSource>();
|
82
84
|
|
@@ -184,7 +186,9 @@
|
|
184
186
|
|
185
187
|
}
|
186
188
|
|
187
|
-
if (Input.GetMouseButtonDown(0))
|
189
|
+
if (Input.GetMouseButtonDown(0) || Input.GetTouch(0).phase == TouchPhase.Began)
|
190
|
+
|
191
|
+
|
188
192
|
|
189
193
|
{
|
190
194
|
|
@@ -312,7 +316,7 @@
|
|
312
316
|
|
313
317
|
aud.PlayOneShot(damageSE);
|
314
318
|
|
315
|
-
heart -= PlayerPrefs.GetInt("level")*2;
|
319
|
+
heart -= PlayerPrefs.GetInt("level")*2;
|
316
320
|
|
317
321
|
Lifetext.text = "HP: " + heart;
|
318
322
|
|
@@ -326,23 +330,17 @@
|
|
326
330
|
|
327
331
|
{
|
328
332
|
|
329
|
-
|
333
|
+
Debug.Log("Attack");
|
330
|
-
|
331
|
-
|
334
|
+
|
332
|
-
|
333
|
-
{
|
334
|
-
|
335
|
-
|
335
|
+
seikai = false;
|
336
|
-
|
336
|
+
|
337
|
-
|
337
|
+
aud.PlayOneShot(AttackSE);
|
338
|
-
|
338
|
+
|
339
|
-
|
339
|
+
heart2 = heart2 - PlayerPrefs.GetInt("level");
|
340
|
-
|
340
|
+
|
341
|
-
|
341
|
+
Text.text = "HP: " + heart2;
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
342
|
+
|
343
|
+
|
346
344
|
|
347
345
|
}
|
348
346
|
|