This commit is contained in:
ohgushiyuga
2026-07-08 16:28:20 +09:00
parent a5f6f7f2d2
commit 43ba4da2df
13 changed files with 4838 additions and 3183 deletions

View File

@@ -53,41 +53,36 @@ public class VRInputPunch : MonoBehaviour
Vector3 velocity = velocityAction.action.ReadValue<Vector3>();
float speed = velocity.magnitude;
//【パリィ判定】当たったオブジェクトが敵の拳だった場合
if (other.CompareTag("EnemyFist"))
{
Debug.Log($"🛡️ [パリィチェック] 敵の拳と接触。プレイヤーの手の速度: {speed:F2} m/s / 構え状態: {poseDetector.IsPosing}");
Debug.Log($"🛡️ [パリィチェック] 敵の拳と接触。構え状態: {poseDetector.IsPosing}");
// 条件構え状態IsPosingである、もしくは、弾くための速度が一定以上出ている場合
if (poseDetector.IsPosing || speed >= minParrySpeed)
if (poseDetector.IsPosing)
{
// 敵の親オブジェクトからEnemyAIスクリプトを検索
EnemyAI enemyAI = other.GetComponentInParent<EnemyAI>();
if (enemyAI != null)
{
// 敵の攻撃コンボを強制中断し、スタン状態にする
enemyAI.TriggerParryStun(parryStunDuration);
// パリィ成功用の強力な振動をプレイヤーに返す
TriggerHaptics(parryHapticAmplitude, parryHapticDuration);
Debug.Log($"🛡️ 【ジャストパリィ成功!】 敵の体勢を崩しました。スタン時間: {parryStunDuration}秒");
return; // パリィが成立した場合は以降のパンチ処理は行わない
return;
}
BossController boss = other.GetComponentInParent<BossController>();
if (boss != null)
{
boss.TriggerParryStun();
TriggerHaptics(parryHapticAmplitude, parryHapticDuration);
Debug.Log("🛡️ 【ジャストパリィ成功!】 ボスの体勢を崩しました!");
return;
}
}
BossController boss = other.GetComponentInParent<BossController>();
if (boss != null)
{
// ボスにパリィ成立を通知(噛みつき・突進中であれば自動でスタンへ移行)
boss.TriggerParryStun();
}
else
{
Debug.Log("🧱 ガード(または速度不足):敵の攻撃は防いだが、弾き返せなかった。");
return;
}
Debug.Log("🧱 ガード(構え不足):敵の攻撃は防いだが、弾き返せなかった。");
return;
}
// ────────────────────────────────────────────────────────────────────────
// パンチ攻撃の処理