Files
ft/Client/Assets/Editor/BingoTool/BingoWeightValidation.cs
2026-06-29 21:18:33 +08:00

44 lines
1.2 KiB
C#

using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class BingoWeightValidation : EditorWindow
{
private int _totalRoundCount = 1000;
private EventBingoTableContext _tc;
public void Init()
{
_tc = new EventBingoTableContext(40000116);
}
private void OnGUI()
{
GUILayout.Label("Bingo权重验证", EditorStyles.boldLabel);
_totalRoundCount = EditorGUILayout.IntField("RoundCount", _totalRoundCount);
if (!GUILayout.Button("走你!"))
return;
int round = 0;
var res = new Dictionary<int, int>();
for (int i = 1; i < 5; i++)
{
res.Add(i, 0);
}
while (round < _totalRoundCount)
{
(int seed, int bingo) = _tc.PickSeedValidation(round);
if (res.ContainsKey(bingo))
res[bingo] += 1;
round++;
}
foreach (var kv in res)
Debug.Log($"[EventBingo] Bingo {kv.Key} seed count {kv.Value}: {kv.Value / (double)_totalRoundCount}");
}
[MenuItem("Window/BingoTool/SeedWeightValidation")]
public static void ShowWindow()
{
var wd = GetWindow<BingoWeightValidation>("验证bingo种子权重");
wd.Init();
}
}