Revert "スクリプトの整理"

This reverts commit e8bdb0920d.
This commit is contained in:
oogushiyuuga
2026-06-30 10:02:08 +09:00
parent 7ffd50bcfd
commit c13225f5e3
6 changed files with 123 additions and 74 deletions

View File

@@ -6,18 +6,19 @@ public class PlayerStatusManager : MonoBehaviour
{
public static PlayerStatusManager Instance { get; private set; }
// CodingModeスタート入力ボタン
[Header("Codingモード用 入力設定")]
[SerializeField] private InputActionProperty zlButtonAction;
[SerializeField] private InputActionProperty zrButtonAction;
// ゲージ設定
[Header("ゲージ設定")]
[SerializeField] private float maxGauge = 100f;
[SerializeField] private float currentGauge = 0f;
// 表示UI設定
[Header("表示UI設定")]
[Tooltip("ミニゲーム画面をまとめている親オブジェクトを指定してください")]
[SerializeField] private GameObject codingModeUI;
// バフパラメータ設定
[Header("バフパラメータ設定")]
[SerializeField] private float buffDuration = 10f;
[SerializeField] private float attackBuffMultiplier = 1.5f;
[SerializeField] private float defenseBuffMultiplier = 0.5f;
@@ -70,7 +71,7 @@ public class PlayerStatusManager : MonoBehaviour
if (isCodingMode) return;
currentGauge += amount;
currentGauge = Mathf.Clamp(currentGauge, 0f, maxGauge);
Debug.Log($"共通ゲージ増加: {currentGauge} / {maxGauge}");
Debug.Log($"🔋 共通ゲージ増加: {currentGauge} / {maxGauge}");
}
private void CheckComboInput()
@@ -98,15 +99,18 @@ public class PlayerStatusManager : MonoBehaviour
if (codingModeUI != null)
{
codingModeUI.SetActive(true);
// ★新設:画面が開いた瞬間にミニゲームの盤面をランダム生成してリセットする
CodingModeGridManager gridManager = codingModeUI.GetComponentInChildren<CodingModeGridManager>();
if (gridManager != null) gridManager.ResetAndGenerateMinigame();
}
}
// ミニゲームクリア時:獲得したバフリストをすべて適用して現実世界を再開する
/// <summary>
/// ★ミニゲームクリア時:獲得したバフリストをすべて適用して現実世界を再開する
/// </summary>
public void CompleteCodingMode(List<string> earnedBuffs)
{
Debug.Log("ハッキング成功! ミニゲームクリア!現実世界に復帰します。");
Debug.Log("💻 【ハッキング成功 ミニゲームクリア!現実世界に復帰します。");
foreach (string buff in earnedBuffs)
{
@@ -116,10 +120,12 @@ public class PlayerStatusManager : MonoBehaviour
ResumeGameplay();
}
// ミニゲーム失敗時:失敗ゾーン接触による強制終了処理(バフなしで復帰)
/// <summary>
/// ★ミニゲーム失敗時:失敗ゾーン接触による強制終了処理(バフなしで復帰)
/// </summary>
public void FailCodingMode()
{
Debug.Log("ハッキング強制失敗 失敗ゾーンに接触しました。バフなしで復帰します。");
Debug.Log("🚨 【ハッキング強制失敗 失敗ゾーンに接触しました。バフなしで復帰します。");
ResumeGameplay();
}
@@ -138,14 +144,15 @@ public class PlayerStatusManager : MonoBehaviour
{
case "AttackUp":
attackBuffTimer = buffDuration;
Debug.Log($"攻撃力UPが適用されました。効果時間: {buffDuration}秒");
Debug.Log($"⚔️ 攻撃力UPが適用されました。効果時間: {buffDuration}秒");
break;
case "DefenseUp":
defenseBuffTimer = buffDuration;
Debug.Log($"防御力UPが適用されました。効果時間: {buffDuration}秒");
Debug.Log($"🛡️ 防御力UPが適用されました。効果時間: {buffDuration}秒");
break;
case "Heal":
Debug.Log($"HP回復が適用されました。回復量: {hpHealAmount}");
Debug.Log($"💚 HP回復が適用されました。回復量: {hpHealAmount}");
// ※将来の拡張PlayerHealth.Instance.Heal(hpHealAmount);
break;
}
}
@@ -155,13 +162,13 @@ public class PlayerStatusManager : MonoBehaviour
if (attackBuffTimer > 0f)
{
attackBuffTimer -= Time.deltaTime;
if (attackBuffTimer <= 0f) Debug.Log("攻撃力UPバフの効果が終了しました。");
if (attackBuffTimer <= 0f) Debug.Log("⚔️ 攻撃力UPバフの効果が終了しました。");
}
if (defenseBuffTimer > 0f)
{
defenseBuffTimer -= Time.deltaTime;
if (defenseBuffTimer <= 0f) Debug.Log("防御力UPバフの効果が終了しました。");
if (defenseBuffTimer <= 0f) Debug.Log("🛡️ 防御力UPバフの効果が終了しました。");
}
}
}