Files
ft/Client/Assets/Scripts/EventBossFight/Panel/EventBossFightMainPanel_Debug.cs
2026-06-29 21:18:33 +08:00

83 lines
3.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
}
}