#include <SpawnableMonitor.h>
Inherits AZ::Data::AssetBus::MultiHandler.
|
enum | IssueType { Error
, Cancel
, ReloadError
} |
|
|
| SpawnableMonitor (AZ::Data::AssetId spawnableAssetId) |
|
virtual | ~SpawnableMonitor () |
| Destroys the monitor, including disconnecting from the spawnable if connected.
|
|
virtual bool | Connect (AZ::Data::AssetId spawnableAssetId) |
|
virtual bool | Disconnect () |
| Disconnects from the monitor if connected and otherwise does nothing and returns false.
|
|
virtual bool | IsConnected () const |
| Returns true if the monitor is connected and otherwise false.
|
|
virtual bool | IsLoaded () const |
| Returns true if the monitor tracked the spawnable able being ready for use, otherwise false.
|
|
|
virtual void | OnSpawnableLoaded () |
| Called when a spawnable has been loaded and is ready for used.
|
|
virtual void | OnSpawnableUnloaded () |
| Called when an spawnable has been unloaded and should no longer be used.
|
|
virtual void | OnSpawnableReloaded (AZ::Data::Asset< Spawnable > &&replacementAsset) |
|
virtual void | OnSpawnableIssue (IssueType issueType, AZStd::string_view message) |
| Called when an error occurred while the Asset Manager did an operation on the spawnable.
|
|
A utility class to make it easier to work with individual spawnables. This class will monitor a spawnable for changes and provides a simplified interface to respond to.
◆ SpawnableMonitor()
AzFramework::SpawnableMonitor::SpawnableMonitor |
( |
AZ::Data::AssetId |
spawnableAssetId | ) |
|
|
explicit |
Constructs the monitor to immediately start monitoring a specific spawnable. Depending on the state of the spawnable this can result in immediate calls to OnSpawnable* functions.
◆ Connect()
virtual bool AzFramework::SpawnableMonitor::Connect |
( |
AZ::Data::AssetId |
spawnableAssetId | ) |
|
|
virtual |
Connects the monitor to start monitoring a specific spawnable. Depending on the state of the spawnable this can result in immediate calls to OnSpawnable* functions. If the monitor is already connected this will do nothing and return false.
◆ OnSpawnableReloaded()
virtual void AzFramework::SpawnableMonitor::OnSpawnableReloaded |
( |
AZ::Data::Asset< Spawnable > && |
replacementAsset | ) |
|
|
protectedvirtual |
Called when a spawnable has been reloaded. Note that if the replacement isn't used to replace the original spawnable then the replacement asset will eventually run out of references and send an OnSpawnableUnloaded event.
The documentation for this class was generated from the following file:
- Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableMonitor.h