bosuheya chouseimae
This commit is contained in:
@@ -27,13 +27,13 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7127456385706922585}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: -0.7071068}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 83.62, y: -8.22, z: -7.05}
|
||||
m_LocalScale: {x: 7, y: 7, z: 7}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 270, y: 0, z: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &1825556039889797282
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -1273,8 +1273,8 @@ MonoBehaviour:
|
||||
features:
|
||||
- {fileID: 7011443450567333355}
|
||||
- {fileID: -671281728444007487}
|
||||
- {fileID: -901939997048047619}
|
||||
- {fileID: -1734471456787174204}
|
||||
- {fileID: 6956056911768161135}
|
||||
- {fileID: 5091991234558418143}
|
||||
- {fileID: 8980318060753866109}
|
||||
- {fileID: -6559185765804338520}
|
||||
- {fileID: -4756202077021157709}
|
||||
@@ -1285,7 +1285,7 @@ MonoBehaviour:
|
||||
- {fileID: 348827886137839178}
|
||||
- {fileID: -7499073031166464939}
|
||||
- {fileID: 7666556398442971420}
|
||||
- {fileID: 431653824124869831}
|
||||
- {fileID: 1118878472687837173}
|
||||
- {fileID: 3985858319333531581}
|
||||
- {fileID: -6511185071715886993}
|
||||
- {fileID: -4363231183632145407}
|
||||
|
||||
@@ -702,6 +702,10 @@ MonoBehaviour:
|
||||
groundAnchor: {fileID: 1519524653}
|
||||
<AttackRadius>k__BackingField: 10
|
||||
<JumpRoarDuration>k__BackingField: 5
|
||||
<CeilingAttackDuration>k__BackingField: 8
|
||||
<CeilingShotInterval>k__BackingField: 0.2
|
||||
<WebWarningDelay>k__BackingField: 0.8
|
||||
<WebDuration>k__BackingField: 3
|
||||
warningMarkerPrefab: {fileID: 4416133559060049660, guid: bbba2f965a48a1f41aa3aa75745eafc0, type: 3}
|
||||
webPrefab: {fileID: 7127456385706922585, guid: 6cee7cb816e34c1478e31e98e258a22a, type: 3}
|
||||
--- !u!195 &139010308
|
||||
@@ -745,8 +749,8 @@ BoxCollider:
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 2, y: 2, z: 2}
|
||||
m_Center: {x: 0, y: 0, z: 1.2}
|
||||
m_Size: {x: 1, y: 2, z: 1}
|
||||
m_Center: {x: 0, y: 1, z: 1.8}
|
||||
--- !u!54 &139010317
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -774,6 +778,18 @@ Rigidbody:
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!114 &139010320
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 139010306}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d2cd755b0c100204e833df85acb412e8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::BossDebugController
|
||||
--- !u!1 &142265989
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1647,7 +1663,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400000, guid: d9d1fbfcf69364ffd8f9c6ade9ce90fe, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -2.3648567
|
||||
value: -15.8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400000, guid: d9d1fbfcf69364ffd8f9c6ade9ce90fe, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
@@ -1659,7 +1675,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400000, guid: d9d1fbfcf69364ffd8f9c6ade9ce90fe, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0.9455186
|
||||
value: 0.98599327
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400000, guid: d9d1fbfcf69364ffd8f9c6ade9ce90fe, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
@@ -1667,7 +1683,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400000, guid: d9d1fbfcf69364ffd8f9c6ade9ce90fe, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0.32556805
|
||||
value: 0.16678526
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400000, guid: d9d1fbfcf69364ffd8f9c6ade9ce90fe, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
@@ -1679,7 +1695,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400000, guid: d9d1fbfcf69364ffd8f9c6ade9ce90fe, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 38
|
||||
value: 19.202
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400000, guid: d9d1fbfcf69364ffd8f9c6ade9ce90fe, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
@@ -1930,7 +1946,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400000, guid: d9d1fbfcf69364ffd8f9c6ade9ce90fe, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 32.56478
|
||||
value: 31.8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 400000, guid: d9d1fbfcf69364ffd8f9c6ade9ce90fe, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
@@ -4302,6 +4318,9 @@ PrefabInstance:
|
||||
- targetCorrespondingSourceObject: {fileID: 1987720806421918, guid: a2dfe588a42016e40892b72d31fd1cf6, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 139010317}
|
||||
- targetCorrespondingSourceObject: {fileID: 1987720806421918, guid: a2dfe588a42016e40892b72d31fd1cf6, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 139010320}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: a2dfe588a42016e40892b72d31fd1cf6, type: 3}
|
||||
--- !u!1001 &1153141912
|
||||
PrefabInstance:
|
||||
@@ -4686,7 +4705,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1030989063, guid: abc00000000014917668085838676610, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 13
|
||||
value: 8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1030989063, guid: abc00000000014917668085838676610, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
@@ -4694,11 +4713,11 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1030989063, guid: abc00000000014917668085838676610, type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 13
|
||||
value: 8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1030989063, guid: abc00000000014917668085838676610, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 99.7
|
||||
value: 79.7
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1030989063, guid: abc00000000014917668085838676610, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
@@ -5100,7 +5119,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &1398221365
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -5110,7 +5129,7 @@ Transform:
|
||||
m_GameObject: {fileID: 1398221364}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -0.22, z: -0.32}
|
||||
m_LocalPosition: {x: -0.015, y: -0.22, z: 0.081}
|
||||
m_LocalScale: {x: 0.45, y: 0.25, z: 0.35}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -5495,7 +5514,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8806329115733545878, guid: 77e7c27b2c5525e4aa8cc9f99d654486, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -0.37
|
||||
value: -0.357
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8806329115733545878, guid: 77e7c27b2c5525e4aa8cc9f99d654486, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
|
||||
Binary file not shown.
@@ -21,7 +21,16 @@ public class BossController : MonoBehaviour, IDamageble
|
||||
[SerializeField] public Transform groundAnchor;
|
||||
[field: SerializeField] public float AttackRadius { get; private set; } = 10f;
|
||||
[field: SerializeField] public float JumpRoarDuration { get; private set; } = 5f;
|
||||
[field: SerializeField] public float CeilingAttackDuration { get; private set; } = 8.0f;
|
||||
|
||||
[Tooltip("★新設:糸を降らせる時間間隔(秒)。数値を小さくする(例: 0.1)ほど弾数が激増して密度が上がります")]
|
||||
[field: SerializeField] public float CeilingShotInterval { get; private set; } = 0.2f;
|
||||
|
||||
[Tooltip("★新設:地面に赤マーク(予兆)が出てから、本物の糸が降ってくるまでのタイムラグ(秒)")]
|
||||
[field: SerializeField] public float WebWarningDelay { get; private set; } = 0.8f;
|
||||
|
||||
[Tooltip("★新設:地面に生成された糸が消えずに残り続ける時間(秒)")]
|
||||
[field: SerializeField] public float WebDuration { get; private set; } = 3.0f;
|
||||
[SerializeField] private GameObject warningMarkerPrefab;
|
||||
[SerializeField] private GameObject webPrefab;
|
||||
|
||||
@@ -165,7 +174,10 @@ public class BossController : MonoBehaviour, IDamageble
|
||||
|
||||
if (webPrefab != null)
|
||||
{
|
||||
GameObject web = Instantiate(webPrefab, pos, Quaternion.identity);
|
||||
Quaternion webRotation = Quaternion.Euler(270f, 0f, 0f);
|
||||
|
||||
GameObject web = Instantiate(webPrefab, pos + new Vector3(0, 0.5f, 0), webRotation);
|
||||
|
||||
Destroy(web, duration);
|
||||
}
|
||||
}
|
||||
@@ -180,6 +192,27 @@ public class BossController : MonoBehaviour, IDamageble
|
||||
Anim.ResetTrigger("Land");
|
||||
Anim.ResetTrigger("StunStart");
|
||||
}
|
||||
|
||||
#region デバッグ用機能
|
||||
/// <summary>
|
||||
/// Unityインスペクターの右上メニューから実行できるデバッグ用コマンドです
|
||||
/// </summary>
|
||||
[ContextMenu("🛠️ デバッグ:強制必殺技(天井ジャンプ)")]
|
||||
public void DebugTriggerUltimate()
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
Debug.LogWarning("⚠️ ゲームが再生中(Playモード)の時のみ実行可能です。");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("🛠️ 【デバッグ操作】必殺技の予約券を発行し、強制的に天井ジャンプステートへ遷移します。");
|
||||
|
||||
// 必殺技の発動権をONにし、現在の行動をキャンセルして天井ジャンプへ移行
|
||||
PendingUltimate = true;
|
||||
ChangeState<SpiderJumpToCeilingState>();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// 共通データ(boss参照)を自動保持し、各子ステートの無駄なコードを極限まで削ります。
|
||||
|
||||
44
Assets/_Scripts/Bossdebug.cs
Normal file
44
Assets/_Scripts/Bossdebug.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class BossDebugController : MonoBehaviour
|
||||
{
|
||||
private BossController bossController;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
// 同一オブジェクトにあるBossControllerを自動取得
|
||||
bossController = GetComponent<BossController>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// ─── ★キーボードの『U(Ultimate)』キーを押したら強制発動 ───
|
||||
if (Input.GetKeyDown(KeyCode.U))
|
||||
{
|
||||
TriggerDebugUltimate();
|
||||
}
|
||||
|
||||
// ─── ついでにあると便利な機能:『S(Stun)』キーで即座にパリィスタン ───
|
||||
if (Input.GetKeyDown(KeyCode.S))
|
||||
{
|
||||
TriggerDebugStun();
|
||||
}
|
||||
}
|
||||
|
||||
private void TriggerDebugUltimate()
|
||||
{
|
||||
if (bossController == null) return;
|
||||
|
||||
Debug.Log("🛠️ 【キーボードデバッグ】強制的に必殺技(天井ジャンプ)を発動します。");
|
||||
bossController.PendingUltimate = true;
|
||||
bossController.ChangeState<SpiderJumpToCeilingState>();
|
||||
}
|
||||
|
||||
private void TriggerDebugStun()
|
||||
{
|
||||
if (bossController == null) return;
|
||||
|
||||
Debug.Log("🛡️ 【キーボードデバッグ】強制的にパリィスタン(チャンスタイム)を発動します。");
|
||||
bossController.ChangeState<SpiderStunState>();
|
||||
}
|
||||
}
|
||||
2
Assets/_Scripts/Bossdebug.cs.meta
Normal file
2
Assets/_Scripts/Bossdebug.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2cd755b0c100204e833df85acb412e8
|
||||
@@ -216,10 +216,11 @@ public class SpiderJumpToCeilingState : SpiderStateBase
|
||||
}
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// ■ STATE: CEILING ATTACK (インスペクター無段階調整版)
|
||||
// ==========================================
|
||||
public class SpiderCeilingAttackState : SpiderStateBase
|
||||
{
|
||||
private float stateDuration = 7.0f;
|
||||
private float shotInterval = 0.4f;
|
||||
private float timer = 0f;
|
||||
private float shotTimer = 0f;
|
||||
|
||||
@@ -227,11 +228,13 @@ public class SpiderCeilingAttackState : SpiderStateBase
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
timer = stateDuration;
|
||||
// ★リファクタリング:インスペクターで設定した必殺技の長さを適用
|
||||
timer = boss.CeilingAttackDuration;
|
||||
shotTimer = 0f;
|
||||
|
||||
boss.Anim.SetBool("IsOnCeiling", true);
|
||||
boss.PendingUltimate = false;
|
||||
Debug.Log("🕸️ 蜘蛛ボス:天井から無数の糸を乱射中!");
|
||||
Debug.Log($"🕸️ 蜘蛛ボス:天井からの乱射開始! 持続時間: {timer}秒 / 発射間隔: {boss.CeilingShotInterval}秒");
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
@@ -247,10 +250,13 @@ public class SpiderCeilingAttackState : SpiderStateBase
|
||||
timer -= Time.deltaTime;
|
||||
shotTimer -= Time.deltaTime;
|
||||
|
||||
// タイマーがゼロになったら発射
|
||||
if (shotTimer <= 0f)
|
||||
{
|
||||
ExecuteRandomWebAttack();
|
||||
shotTimer = shotInterval;
|
||||
|
||||
// ★リファクタリング:インスペクターで設定した間隔(秒)でリセットして弾数を制御
|
||||
shotTimer = boss.CeilingShotInterval;
|
||||
}
|
||||
|
||||
if (timer <= 0f)
|
||||
@@ -261,6 +267,7 @@ public class SpiderCeilingAttackState : SpiderStateBase
|
||||
|
||||
private void ExecuteRandomWebAttack()
|
||||
{
|
||||
// インスペクターで設定された半径(AttackRadius)を基準にランダム座標を計算
|
||||
Vector2 randomCircle = Random.insideUnitCircle * boss.AttackRadius;
|
||||
Vector3 targetGroundPos = new Vector3(
|
||||
boss.groundAnchor.position.x + randomCircle.x,
|
||||
@@ -268,10 +275,10 @@ public class SpiderCeilingAttackState : SpiderStateBase
|
||||
boss.groundAnchor.position.z + randomCircle.y
|
||||
);
|
||||
|
||||
boss.SpawnWarningAndWeb(targetGroundPos, 1.0f, 2.5f);
|
||||
// ★リファクタリング:予兆マークのディレイや糸の生存時間もインスペクターと完全連動
|
||||
boss.SpawnWarningAndWeb(targetGroundPos, boss.WebWarningDelay, boss.WebDuration);
|
||||
}
|
||||
}
|
||||
|
||||
public class SpiderStunState : SpiderStateBase
|
||||
{
|
||||
private float stunTimer;
|
||||
|
||||
@@ -20,6 +20,9 @@ public class VRInputPunch : MonoBehaviour
|
||||
[SerializeField] private float parryStunDuration = 3.0f; // スタン時間(秒)
|
||||
[SerializeField] private float parryHapticAmplitude = 0.9f; // パリィ成功時の振動の強さ
|
||||
[SerializeField] private float parryHapticDuration = 0.25f; // パリィ成功時の振動の長さ
|
||||
// ─── 多段ヒット・連続暴発防止用タイマー ───
|
||||
private float punchHitCooldown = 0f; // 次のパンチが当たるまでのインターバル
|
||||
private float parryTriggerCooldown = 0f; // 次のパリィが成功するまでのインターバル
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
@@ -51,40 +54,51 @@ public class VRInputPunch : MonoBehaviour
|
||||
Vector3 velocity = velocityAction.action.ReadValue<Vector3>();
|
||||
float speed = velocity.magnitude;
|
||||
|
||||
// ========================================================================
|
||||
// 【パリィ判定】当たったオブジェクトが敵の拳だった場合
|
||||
// ========================================================================
|
||||
if (other.CompareTag("EnemyFist"))
|
||||
{
|
||||
Debug.Log($"🛡️ [パリィチェック] 敵の拳と接触。構え状態: {poseDetector.IsPosing}");
|
||||
|
||||
// 自分が「構え状態」のときだけパリィの成立チェックを行う
|
||||
if (poseDetector.IsPosing)
|
||||
{
|
||||
// 1. ザコ敵(EnemyAI)へのパリィ判定
|
||||
EnemyAI enemyAI = other.GetComponentInParent<EnemyAI>();
|
||||
if (enemyAI != null)
|
||||
{
|
||||
enemyAI.TriggerParryStun(parryStunDuration);
|
||||
TriggerHaptics(parryHapticAmplitude, parryHapticDuration);
|
||||
|
||||
Debug.Log($"🛡️ 【ジャストパリィ成功!】 敵の体勢を崩しました。スタン時間: {parryStunDuration}秒");
|
||||
return;
|
||||
Debug.Log($"🛡️ 【ジャストパリィ成功!】 敵の体勢を崩しました。");
|
||||
return; // ★本当のパリィ成功時のみ、ここで処理を終了する
|
||||
}
|
||||
|
||||
// 2. ボス(BossController)へのパリィ判定
|
||||
BossController boss = other.GetComponentInParent<BossController>();
|
||||
if (boss != null)
|
||||
{
|
||||
// ★リファクタリング:ボスが本当に攻撃中(Bite/Charge)で、パリィが成功した時だけ終了する
|
||||
if (boss.TriggerParryStun())
|
||||
{
|
||||
TriggerHaptics(parryHapticAmplitude, parryHapticDuration);
|
||||
|
||||
Debug.Log("🛡️ 【ジャストパリィ成功!】 ボスの体勢を崩しました!");
|
||||
return;
|
||||
return; // ★本当のパリィ成功時のみ、ここで処理を終了する
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log("🧱 ガード(構え不足):敵の攻撃は防いだが、弾き返せなかった。");
|
||||
// ─── ★ここが今回の核心(超重要リファクタリング) ───
|
||||
// 構え状態ではなかった場合、またはボスが攻撃中でなくパリィが不成立だった場合は、
|
||||
// 「プレイヤーが隙を狙って殴りに行った」とみなして、returnせずにそのまま下のパンチ処理へ流す!
|
||||
Debug.Log("🥊 パリィ不成立、または攻撃チャンス:通常のパンチダメージ処理へ移行します。");
|
||||
}
|
||||
// ────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
// パンチ攻撃の処理
|
||||
// ========================================================================
|
||||
// 【パンチ攻撃の処理】
|
||||
// ========================================================================
|
||||
Debug.Log($"[InputSystem接触] {other.name} に触れました。センサー速度: {speed:F2} m/s");
|
||||
|
||||
if (speed >= minPunchSpeed)
|
||||
|
||||
Reference in New Issue
Block a user