| | |
| | | private int itemCount = 1; |
| | | private bool isBattlePaused = false; |
| | | private bool showBattleInfo = false; |
| | | private bool showGmPanel = true; // 显示GM面板(左侧整个区域) |
| | | private List<string> gmMessages = new List<string>(); // 存储GM消息 |
| | | private List<string> gmCommandHistory = new List<string>(); // 存储历史GM命令 |
| | | private const int maxGmMessages = 50; // 最多保存50条消息 |
| | |
| | | |
| | | private void OnGUI() |
| | | { |
| | | // ========== 顶部功能开关区域 ========== |
| | | GUILayout.BeginVertical("box"); |
| | | GUILayout.Label("功能面板", EditorStyles.boldLabel); |
| | | |
| | | GUILayout.BeginHorizontal(); |
| | | GUILayout.FlexibleSpace(); |
| | | |
| | | // 显示战场信息开关 |
| | | GUILayout.Label("显示战场信息", GUILayout.Width(100)); |
| | | showBattleInfo = EditorGUILayout.Toggle(showBattleInfo, GUILayout.Width(20)); |
| | | |
| | | GUILayout.Space(20); |
| | | |
| | | // 显示GM面板开关 |
| | | GUILayout.Label("显示GM", GUILayout.Width(100)); |
| | | showGmPanel = EditorGUILayout.Toggle(showGmPanel, GUILayout.Width(20)); |
| | | |
| | | GUILayout.FlexibleSpace(); |
| | | GUILayout.EndHorizontal(); |
| | | |
| | | GUILayout.EndVertical(); |
| | | |
| | | GUILayout.Space(5); |
| | | |
| | | GUILayout.BeginHorizontal(); |
| | | |
| | | // ========== 左侧面板 ========== |
| | | float leftWidth = showBattleInfo ? position.width * 0.6f : position.width - 20; |
| | | GUILayout.BeginVertical("box", GUILayout.Width(leftWidth)); |
| | | // ========== 左侧面板 - GM工具 ========== |
| | | if (showGmPanel) |
| | | { |
| | | float leftWidth = showBattleInfo ? position.width * 0.6f : position.width - 20; |
| | | GUILayout.BeginVertical("box", GUILayout.Width(leftWidth)); |
| | | |
| | | // 搜索栏 |
| | | GUILayout.Label("物品搜索", EditorStyles.boldLabel); |
| | |
| | | warningStyle.fontSize = 11; |
| | | EditorGUILayout.LabelField("⚠ 添加物品最好跟服务器确认过物品的存在后再添加", warningStyle); |
| | | |
| | | GUILayout.Space(10); |
| | | |
| | | // 战场信息Toggle |
| | | GUILayout.BeginHorizontal(); |
| | | GUILayout.FlexibleSpace(); |
| | | GUILayout.Label("显示战场信息", GUILayout.Width(100)); |
| | | showBattleInfo = EditorGUILayout.Toggle(showBattleInfo, GUILayout.Width(20)); |
| | | GUILayout.FlexibleSpace(); |
| | | GUILayout.EndHorizontal(); |
| | | |
| | | GUILayout.EndVertical(); |
| | | } |
| | | |
| | | // ========== 右侧面板 - 战场信息 ========== |
| | | if (showBattleInfo) |
| | |
| | | |
| | | GUILayout.Space(10); |
| | | |
| | | // 红方队伍信息 |
| | | // 红蓝双方队伍信息(横向排列) |
| | | GUILayout.BeginHorizontal(); |
| | | |
| | | // 红方队伍(左侧) |
| | | GUILayout.BeginVertical("box", GUILayout.ExpandWidth(true)); |
| | | DrawTeamInfo("红方队伍", battleField.battleObjMgr.redCampList, new Color(1f, 0.5f, 0.5f)); |
| | | GUILayout.EndVertical(); |
| | | |
| | | GUILayout.Space(10); |
| | | |
| | | // 蓝方队伍信息 |
| | | // 蓝方队伍(右侧) |
| | | GUILayout.BeginVertical("box", GUILayout.ExpandWidth(true)); |
| | | DrawTeamInfo("蓝方队伍", battleField.battleObjMgr.blueCampList, new Color(0.5f, 0.5f, 1f)); |
| | | GUILayout.EndVertical(); |
| | | |
| | | GUILayout.EndHorizontal(); |
| | | } |
| | | |
| | | private void DrawTeamInfo(string teamName, List<BattleObject> team, Color headerColor) |
| | |
| | | GUILayout.Label($"{curMp}/{maxMp} ({(mpPercent * 100f):F1}%)", GUILayout.Width(150)); |
| | | GUILayout.EndHorizontal(); |
| | | |
| | | // Buff信息 |
| | | if (obj.buffMgr != null) |
| | | { |
| | | var buffList = obj.buffMgr.GetBuffDataList(); |
| | | if (buffList != null && buffList.Count > 0) |
| | | { |
| | | GUILayout.Space(5); |
| | | GUILayout.Label("Buff列表:", EditorStyles.miniBoldLabel); |
| | | |
| | | foreach (var buffData in buffList) |
| | | { |
| | | if (buffData != null) |
| | | { |
| | | string buffName = SkillConfig.Get((int)buffData.SkillID).SkillName; |
| | | int layer = buffData.Layer; |
| | | |
| | | GUILayout.BeginHorizontal(); |
| | | GUILayout.Space(20); |
| | | GUILayout.Label($"• {buffName} x{layer}", EditorStyles.miniLabel); |
| | | GUILayout.EndHorizontal(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | GUILayout.EndVertical(); |
| | | } |
| | | } |