Hierarchy imgui debugger, first take

Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com>
This commit is contained in:
AMZN-Olex
2021-10-07 08:27:48 -04:00
parent 3d1ec83f78
commit 77c23b6c8f
5 changed files with 283 additions and 0 deletions
@@ -0,0 +1,52 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Component/EntityBus.h>
#include <AzCore/EBus/ScheduledEvent.h>
#include <AzFramework/Entity/EntityDebugDisplayBus.h>
#include <Multiplayer/Components/NetworkHierarchyRootComponent.h>
namespace Multiplayer
{
class MultiplayerDebugHierarchyReporter
: public AZ::EntitySystemBus::Handler
{
public:
MultiplayerDebugHierarchyReporter();
~MultiplayerDebugHierarchyReporter() override;
//! main update loop
void OnImGuiUpdate();
//! Draws bandwidth text over entities
void UpdateDebugOverlay();
//! EntitySystemBus overrides.
void OnEntityActivated(const AZ::EntityId& entityId) override;
void OnEntityDeactivated(const AZ::EntityId& entityId) override;
private:
AZ::ScheduledEvent m_updateDebugOverlay;
AzFramework::DebugDisplayRequests* m_debugDisplay = nullptr;
struct HierarchyRootInfo
{
NetworkHierarchyRootComponent* m_rootComponent = nullptr;
NetworkHierarchyChangedEvent::Handler m_changedEvent;
NetworkHierarchyLeaveEvent::Handler m_leaveEvent;
};
AZStd::unordered_map<NetworkHierarchyRootComponent*, HierarchyRootInfo> m_hierarchyRoots;
void CollectHierarchyRoots();
char m_statusBuffer[100] = {};
};
}