135 lines
4.9 KiB
C#
135 lines
4.9 KiB
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace Streamingle.Contents.BossRaid.Editor
|
|
{
|
|
/// <summary>
|
|
/// BossRaidManager의 커스텀 인스펙터.
|
|
/// 방송 중 실시간 제어 버튼들을 제공합니다.
|
|
/// </summary>
|
|
[CustomEditor(typeof(BossRaidManager))]
|
|
public class BossRaidManagerEditor : UnityEditor.Editor
|
|
{
|
|
#region Fields
|
|
|
|
private float _hpSlider = 1f;
|
|
private int _forcePhaseIndex;
|
|
private int _manualDamage = 50;
|
|
|
|
#endregion
|
|
|
|
#region Editor
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
DrawDefaultInspector();
|
|
|
|
var manager = (BossRaidManager)target;
|
|
|
|
EditorGUILayout.Space(10);
|
|
EditorGUILayout.LabelField("Live Control Panel", EditorStyles.boldLabel);
|
|
EditorGUILayout.HelpBox("방송 중 실시간 제어용 패널입니다.", MessageType.Info);
|
|
|
|
if (!Application.isPlaying)
|
|
{
|
|
EditorGUILayout.HelpBox("Play 모드에서만 사용 가능합니다.", MessageType.Warning);
|
|
return;
|
|
}
|
|
|
|
EditorGUILayout.Space(5);
|
|
|
|
// 현재 상태 표시
|
|
EditorGUILayout.LabelField("현재 상태", manager.CurrentState.ToString(), EditorStyles.boldLabel);
|
|
|
|
if (manager.Boss != null)
|
|
{
|
|
var boss = manager.Boss;
|
|
EditorGUILayout.LabelField("보스 HP",
|
|
$"{boss.CurrentHP} / {boss.MaxHP} ({boss.HPRatio * 100:F1}%)");
|
|
EditorGUILayout.LabelField("페이즈",
|
|
boss.CurrentPhase?.phaseName ?? "N/A");
|
|
EditorGUILayout.LabelField("상태",
|
|
boss.CurrentState.ToString());
|
|
}
|
|
|
|
EditorGUILayout.Space(10);
|
|
|
|
// === 레이드 제어 ===
|
|
EditorGUILayout.LabelField("레이드 제어", EditorStyles.boldLabel);
|
|
|
|
EditorGUILayout.BeginHorizontal();
|
|
if (GUILayout.Button("Start Raid", GUILayout.Height(30)))
|
|
manager.StartRaid();
|
|
if (GUILayout.Button("Stop Raid", GUILayout.Height(30)))
|
|
manager.StopRaid();
|
|
EditorGUILayout.EndHorizontal();
|
|
|
|
EditorGUILayout.Space(5);
|
|
|
|
// === 전투 제어 ===
|
|
EditorGUILayout.LabelField("전투 제어", EditorStyles.boldLabel);
|
|
|
|
// 일시정지
|
|
EditorGUILayout.BeginHorizontal();
|
|
bool isPaused = manager.Safety?.IsPaused ?? false;
|
|
GUI.backgroundColor = isPaused ? Color.red : Color.green;
|
|
if (GUILayout.Button(isPaused ? "PAUSED - Resume" : "Pause", GUILayout.Height(25)))
|
|
manager.TogglePause();
|
|
GUI.backgroundColor = Color.white;
|
|
EditorGUILayout.EndHorizontal();
|
|
|
|
EditorGUILayout.Space(5);
|
|
|
|
// 수동 데미지
|
|
EditorGUILayout.BeginHorizontal();
|
|
_manualDamage = EditorGUILayout.IntField("수동 데미지", _manualDamage);
|
|
if (GUILayout.Button("Hit!", GUILayout.Width(60)))
|
|
manager.ManualHit(_manualDamage);
|
|
if (GUILayout.Button("Auto Hit", GUILayout.Width(80)))
|
|
manager.ManualHit();
|
|
EditorGUILayout.EndHorizontal();
|
|
|
|
EditorGUILayout.Space(5);
|
|
|
|
// === HP 조절 ===
|
|
EditorGUILayout.LabelField("HP 조절", EditorStyles.boldLabel);
|
|
|
|
EditorGUILayout.BeginHorizontal();
|
|
_hpSlider = EditorGUILayout.Slider("HP %", _hpSlider, 0f, 1f);
|
|
if (GUILayout.Button("Set", GUILayout.Width(40)))
|
|
manager.SetBossHP(_hpSlider);
|
|
EditorGUILayout.EndHorizontal();
|
|
|
|
EditorGUILayout.BeginHorizontal();
|
|
if (GUILayout.Button("100%")) manager.SetBossHP(1f);
|
|
if (GUILayout.Button("75%")) manager.SetBossHP(0.75f);
|
|
if (GUILayout.Button("50%")) manager.SetBossHP(0.5f);
|
|
if (GUILayout.Button("25%")) manager.SetBossHP(0.25f);
|
|
if (GUILayout.Button("10%")) manager.SetBossHP(0.1f);
|
|
EditorGUILayout.EndHorizontal();
|
|
|
|
EditorGUILayout.Space(5);
|
|
|
|
// === 페이즈 / 처치 ===
|
|
EditorGUILayout.LabelField("페이즈 & 처치", EditorStyles.boldLabel);
|
|
|
|
EditorGUILayout.BeginHorizontal();
|
|
_forcePhaseIndex = EditorGUILayout.IntField("페이즈", _forcePhaseIndex);
|
|
if (GUILayout.Button("Force Phase", GUILayout.Width(100)))
|
|
manager.ForcePhase(_forcePhaseIndex);
|
|
EditorGUILayout.EndHorizontal();
|
|
|
|
GUI.backgroundColor = new Color(1f, 0.3f, 0.3f);
|
|
if (GUILayout.Button("FORCE KILL", GUILayout.Height(30)))
|
|
manager.ForceKill();
|
|
GUI.backgroundColor = Color.white;
|
|
|
|
// 리페인트
|
|
if (Application.isPlaying)
|
|
Repaint();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|