Vault Re-Alignment
This commit is contained in:
@@ -62,6 +62,20 @@ namespace ProjectM.Client
|
||||
if (GUILayout.Button("Go Expedition")) DebugCommandSendSystem.Teleport(RegionId.Expedition);
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.Space(6);
|
||||
GUILayout.Label("- Telemetry (MC-0) -");
|
||||
if (DevTelemetryReadout.HasData)
|
||||
{
|
||||
var t = DevTelemetryReadout.Latest;
|
||||
GUILayout.Label($"tick {t.LastSampleTick} husks {t.LiveEnemyCount}");
|
||||
GUILayout.Label($"dash neg {t.DashIFrameNegatedHits} / wasted {t.DashesWasted}");
|
||||
GUILayout.Label($"whiff open {t.ChargerWhiffWindowsOpened} / punish {t.ChargerWhiffPunishesLanded}");
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Label("(waiting for server telemetry...)");
|
||||
}
|
||||
|
||||
GUILayout.EndArea();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
#if UNITY_EDITOR
|
||||
using Unity.Collections;
|
||||
using Unity.Entities;
|
||||
using Unity.NetCode;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ProjectM.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// MC-0 — EDITOR-ONLY client receiver for the periodic <see cref="ProjectM.Simulation.DebugTelemetryReport"/>.
|
||||
/// Drains the snapshot into <see cref="DevTelemetryReadout"/> (a plain static) so the IMGUI <c>DebugOverlay</c>
|
||||
/// reads NO ECS state directly (the job-safety rule for presentation). Plain client
|
||||
/// <see cref="SimulationSystemGroup"/>; non-Burst (touches a managed static).
|
||||
/// </summary>
|
||||
[WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation)]
|
||||
[UpdateInGroup(typeof(SimulationSystemGroup))]
|
||||
public partial struct DevTelemetryReceiveSystem : ISystem
|
||||
{
|
||||
public void OnCreate(ref SystemState state)
|
||||
{
|
||||
var builder = new EntityQueryBuilder(Allocator.Temp)
|
||||
.WithAll<ProjectM.Simulation.DebugTelemetryReport, ReceiveRpcCommandRequest>();
|
||||
state.RequireForUpdate(state.GetEntityQuery(builder));
|
||||
}
|
||||
|
||||
public void OnUpdate(ref SystemState state)
|
||||
{
|
||||
var ecb = new EntityCommandBuffer(Allocator.Temp);
|
||||
foreach (var (report, reqEntity) in
|
||||
SystemAPI.Query<RefRO<ProjectM.Simulation.DebugTelemetryReport>>()
|
||||
.WithAll<ReceiveRpcCommandRequest>().WithEntityAccess())
|
||||
{
|
||||
var r = report.ValueRO;
|
||||
DevTelemetryReadout.Latest = new DevTelemetryReadout.Snapshot
|
||||
{
|
||||
DashIFrameNegatedHits = r.DashIFrameNegatedHits,
|
||||
DashesWasted = r.DashesWasted,
|
||||
ChargerWhiffWindowsOpened = r.ChargerWhiffWindowsOpened,
|
||||
ChargerWhiffPunishesLanded = r.ChargerWhiffPunishesLanded,
|
||||
LiveEnemyCount = r.LiveEnemyCount,
|
||||
LastSampleTick = r.LastSampleTick,
|
||||
};
|
||||
DevTelemetryReadout.HasData = true;
|
||||
ecb.DestroyEntity(reqEntity);
|
||||
}
|
||||
ecb.Playback(state.EntityManager);
|
||||
ecb.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MC-0 — static bridge from the ECS telemetry receiver to the IMGUI <c>DebugOverlay</c> (so the overlay reads
|
||||
/// a plain struct, never ECS state). Reset on play-enter so a fast-enter-playmode reload can't show stale data.
|
||||
/// </summary>
|
||||
public static class DevTelemetryReadout
|
||||
{
|
||||
public struct Snapshot
|
||||
{
|
||||
public uint DashIFrameNegatedHits;
|
||||
public uint DashesWasted;
|
||||
public uint ChargerWhiffWindowsOpened;
|
||||
public uint ChargerWhiffPunishesLanded;
|
||||
public uint LiveEnemyCount;
|
||||
public uint LastSampleTick;
|
||||
}
|
||||
|
||||
public static Snapshot Latest;
|
||||
public static bool HasData;
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
static void Reset()
|
||||
{
|
||||
Latest = default;
|
||||
HasData = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 685c34765eac3434aadf08c13fce1aa5
|
||||
Reference in New Issue
Block a user