Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Data::AssetEvents Class Reference

#include <AssetCommon.h>

Inherits AZ::EBusTraits.

Classes

struct  AssetConnectionPolicy
 

Public Types

typedef AZStd::recursive_mutex MutexType
 
typedef AssetId BusIdType
 
template<typename Bus >
using ConnectionPolicy = AssetConnectionPolicy< Bus >
 
- Public Types inherited from AZ::EBusTraits
using AllocatorType = AZ::Internal::EBusEnvironmentAllocator
 
using BusIdType = NullBusId
 
using BusIdOrderCompare = NullBusIdCompare
 
using BusHandlerOrderCompare = BusHandlerCompareDefault
 
using MutexType = NullMutex
 
using EventQueueMutexType = NullMutex
 
template<class Bus >
using ConnectionPolicy = EBusConnectionPolicy< Bus >
 
template<class Context >
using StoragePolicy = EBusEnvironmentStoragePolicy< Context >
 
template<class Bus >
using RouterPolicy = EBusRouterPolicy< Bus >
 
using EventProcessingPolicy = EBusEventProcessingPolicy
 
template<typename DispatchMutex , bool IsLocklessDispatch>
using DispatchLockGuard = AZStd::conditional_t< IsLocklessDispatch, AZ::Internal::NullLockGuard< DispatchMutex >, AZStd::scoped_lock< DispatchMutex > >
 
template<typename ContextMutex >
using ConnectLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 
template<typename ContextMutex >
using BindLockGuard = AZStd::scoped_lock< ContextMutex >
 
template<typename ContextMutex >
using CallstackTrackerLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 

Public Member Functions

 AZ_RTTI (AssetEvents, "{5EA1F709-A268-4C60-BEC0-7CFEED3BA114}")
 
virtual void OnAssetReady (Asset< AssetData > asset)
 Called when an asset is loaded, patched and ready to be used.
 
virtual void OnAssetMoved (Asset< AssetData > asset, void *oldDataPointer)
 Called when an asset has been moved (usually due to de-fragmentation/compaction), if possible the only data pointer is provided otherwise NULL.
 
virtual void OnAssetPreReload (Asset< AssetData > asset)
 Called before an asset reload has started.
 
virtual void OnAssetReloaded (Asset< AssetData > asset)
 Called when an asset has been reloaded (usually in tool mode and loose more). It should not be called in final build.
 
virtual void OnAssetReloadError (Asset< AssetData > asset)
 Called when an asset failed to reload.
 
virtual void OnAssetSaved (Asset< AssetData > asset, bool isSuccessful)
 Called when an asset has been saved. In general most assets can't be saved (in a game) so make sure you check the flag.
 
virtual void OnAssetUnloaded (const AssetId assetId, const AssetType assetType)
 Called when an asset is unloaded.
 
virtual void OnAssetError (Asset< AssetData > asset)
 
virtual void OnAssetCanceled (AssetId assetId)
 Called when an asset load is canceled. This can happen when there are no remaining references to an asset which hasn't finished loading.
 
virtual void OnAssetContainerReady (Asset< AssetData > asset)
 When an asset is loaded as part of a container this signal is sent when all assets within the container are ready.
 

Static Public Attributes

static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById
 
static const bool EnableEventQueue = true
 
- Static Public Attributes inherited from AZ::EBusTraits
static constexpr EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Multiple
 
static constexpr EBusAddressPolicy AddressPolicy = EBusAddressPolicy::Single
 
static constexpr bool EnableEventQueue = false
 
static constexpr bool EventQueueingActiveByDefault = true
 
static constexpr bool EnableQueuedReferences = false
 
static constexpr bool LocklessDispatch = false
 

Friends

class AssetManager
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::EBusTraits
 ~EBusTraits ()=default
 

Detailed Description

AssetEvents All parameters are passed by value because events can be queued.

Member Function Documentation

◆ OnAssetError()

virtual void AZ::Data::AssetEvents::OnAssetError ( Asset< AssetData asset)
inlinevirtual

Called when an error happened with an asset. When this message is received the asset should be considered broken by default. Note that this can happen when the asset errors during load, but also happens when the asset is missing (not in catalog etc.) in the case of an asset that is completely missing, the Asset<T> passed in here will have no hint or other information about the asset since completely missing assets are not registered in the asset manager's database or the catalog.


The documentation for this class was generated from the following file: