using UnityEngine; namespace EventBossFight { public partial class EventBossFightMainPanel { #region Debug #if UNITY_EDITOR [Header("Debug Settings")] [SerializeField] [Tooltip("0=玩家攻击1震动, 1=玩家攻击2震动")] private int debugPlayerShakeIndex; [SerializeField] [Tooltip("目标关卡(从1开始)")] private int debugTargetStage = 1; [SerializeField] [Tooltip("目标格子索引")] private int debugTargetGridID ; [ContextMenu("DEBUG: 播放玩家震动")] private void DebugPlayPlayerShake() { if (playerShakeData == null || playerShakeData.Count == 0) { Debug.LogError("playerShakeData 未配置"); return; } debugPlayerShakeIndex = Mathf.Clamp(debugPlayerShakeIndex, 0, playerShakeData.Count - 1); PlayPlayerAttackShake(debugPlayerShakeIndex); } [ContextMenu("DEBUG: 跳转到指定关卡")] private void DebugJumpToStage() { if (Data?.InitConfig == null) { Debug.LogError("Data 或 InitConfig 为空"); return; } debugTargetStage = Mathf.Clamp(debugTargetStage, 1, Manager.GetResolvedStageIds().Count); Manager.Debug_StartTargetStageFight(debugTargetStage); Start(); Debug.Log($"已跳转到第 {debugTargetStage} 关"); } [ContextMenu("DEBUG: 旋转到指定格子")] private void DebugRotateToGrid() { if (_wheelRewards == null || _wheelRewards.Count == 0) { Debug.LogError("_wheelRewards 未初始化"); return; } if (_isRotating) { Debug.LogWarning("正在旋转中,请等待结束"); return; } _isRotating = true; SetButtonState(false); var reward=_wheelRewards.Find(x => x.Index == debugTargetGridID); if (reward == null) { Debug.LogError($"id {debugTargetGridID} 无效"); _isRotating = false; return; } Manager.Debug_UseDropItem(reward.Index,Data.Magnification,out var convertTokenCount,out var addAmount); _ = _wheel.PlayEffect(_wheelRewards.IndexOf(reward), reward, () => WheelEffectCallBack(reward.Index, addAmount, convertTokenCount)); Debug.Log($"旋转到格子 {debugTargetGridID}: {reward.Index}"); } [SerializeField] private bool isReduceShieldDebug = false; [Tooltip("是否减少玩家血量 勾选这个才播屏幕碎裂特效")] [SerializeField] private bool isReducePlayerHpDebug = false; [ContextMenu("DEBUG: 播放boss攻击动画")] private void DebugPlayBossAttackEffect() { _ = PlayBossAttackEffect(isReduceShieldDebug, isReducePlayerHpDebug); } #endif #endregion } }