回答編集履歴
1
修正
answer
CHANGED
@@ -7,7 +7,8 @@
|
|
7
7
|
//ボタンをクリック(タップ)した時
|
8
8
|
if (isGroud && Input.GetMouseButtonDown(0))
|
9
9
|
{
|
10
|
-
//ヤラレタ場合,クリアした場合ジャンプ不可
|
10
|
+
//ヤラレタ場合,クリアした場合ジャンプ不可
|
11
|
+
----ここに↓isSpringを追加----
|
11
12
|
if ((playerState == PLAYER_STATE.DOWN) || (!isAlive)|| (isSpring))
|
12
13
|
{
|
13
14
|
return;
|
@@ -20,16 +21,17 @@
|
|
20
21
|
{
|
21
22
|
if (col.gameObject.tag == "Spring")
|
22
23
|
{
|
24
|
+
----↓追加処理----
|
23
|
-
isSpring = true;
|
25
|
+
isSpring = true;
|
24
26
|
rd2D.velocity = transform.up * 12f; //バネによるジャンプ動作
|
25
27
|
animator.SetBool("isDash", false); //ダッシュアニメフラグ
|
26
28
|
animator.SetTrigger("Jump"); //ジャンプトリガー
|
27
29
|
audiosource.PlayOneShot(JumpCV3); //ジャンプ;ボイス
|
28
30
|
}
|
29
31
|
}
|
32
|
+
----↓追加処理----
|
30
33
|
void OnTriggerExit2D(Collider2D col)
|
31
34
|
{
|
32
|
-
//追加
|
33
35
|
if (col.gameObject.tag == "Spring")
|
34
36
|
{
|
35
37
|
isSpring = false;
|