You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb zousar.shaker #rb markus.breyer #rb robert.manuszewski #preflight 646391406b1406b54ab15460 [CL 25489627 by kirill zorin in ue5-main branch]
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Containers/Array.h"
|
|
#include "Containers/Map.h"
|
|
#include "Containers/UnrealString.h"
|
|
#include "HAL/Platform.h"
|
|
#include "UObject/GCObject.h"
|
|
|
|
class FReferenceCollector;
|
|
class UClass;
|
|
class UObject;
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// FEditorObjectTracker
|
|
|
|
class FEditorObjectTracker : public FGCObject
|
|
{
|
|
public:
|
|
FEditorObjectTracker(bool bInAllowOnePerClass = true)
|
|
: bAllowOnePerClass(bInAllowOnePerClass)
|
|
{}
|
|
|
|
// FGCObject interface
|
|
virtual void AddReferencedObjects( FReferenceCollector& Collector ) override;
|
|
virtual FString GetReferencerName() const override
|
|
{
|
|
return TEXT("FEditorObjectTracker");
|
|
}
|
|
// End of FGCObject interface
|
|
|
|
/** Returns an existing editor object for the specified class or creates one
|
|
if none exist */
|
|
UObject* GetEditorObjectForClass( UClass* EdClass );
|
|
|
|
void SetAllowOnePerClass(bool bInAllowOnePerClass)
|
|
{
|
|
bAllowOnePerClass = bInAllowOnePerClass;
|
|
}
|
|
private:
|
|
|
|
/** If true, it uses TMap, otherwise, it just uses TArray */
|
|
bool bAllowOnePerClass;
|
|
|
|
/** Tracks editor objects created for details panel */
|
|
TMap< TObjectPtr<UClass>, TObjectPtr<UObject> > EditorObjMap;
|
|
|
|
/** Tracks editor objects created for detail panel */
|
|
TArray<TObjectPtr<UObject>> EditorObjectArray;
|
|
};
|