FGantryPluginReferenceCounts
Counts how many running experiences use each game feature plugin, so a plugin is switched off only when the last one is done with it.
Used on Unreal Engine 5.6 and 5.7.
Each running Activate Game Features stage holds one reference per plugin it activated. The plugin is deactivated when its last reference is released. A plugin that was already active before Gantry first referenced it is never deactivated by Gantry: something else turned it on. On 5.8 the engine's own reference handling does this job and these counts are unused.
Game feature plugins are shared by the whole process, so the counts are too. In a play-in-editor session the server and every client world hold references in the same counts. Game thread only. You normally never call this yourself: the experience stages do.
Members
Get
static FGantryPluginReferenceCounts &
The process-wide counts the experience stages use.
AddReference
void
Takes one reference on a plugin.
PluginURL:The plugin's game feature URL.
bWasAlreadyActive:Whether the plugin was already active before this reference. Only the first reference records it; it decides whether Gantry may take the plugin down when the last reference goes.
ReleaseReference
bool
Drops one reference on a plugin.
Unknown URLs are ignored.
PluginURL:The plugin's game feature URL.
Returns: True when that was the last reference and Gantry owns taking the plugin down.
GetReferenceCount
int32
Current reference count.
PluginURL:The plugin's game feature URL.
Returns: References held on it; 0 for a plugin nothing references.
IsReferenced
bool
Whether Gantry holds any reference on a plugin.
PluginURL:The plugin's game feature URL.
Returns: True while at least one reference is held.
Reset
void
Forgets every reference without deactivating anything.
For tests.