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::SliceAsset Class Reference

#include <SliceAsset.h>

Inherits AZ::Data::AssetData.

Inherited by AZ::DynamicSliceAsset.

Public Member Functions

 AZ_CLASS_ALLOCATOR (SliceAsset, AZ::SystemAllocator)
 
 AZ_RTTI (SliceAsset, "{C62C7A87-9C09-4148-A985-12F2C99C0A45}", AssetData)
 
 SliceAsset (const Data::AssetId &assetId=Data::AssetId())
 
bool SetData (Entity *entity, SliceComponent *component, bool deleteExisting=true)
 
EntityGetEntity ()
 
SliceComponentGetComponent ()
 
virtual SliceAssetClone ()
 
bool HandleAutoReload () override
 
void SetIgnoreNextAutoReload (bool ignoreNextAutoReload)
 
- Public Member Functions inherited from AZ::Data::AssetData
 AZ_CLASS_ALLOCATOR (AssetData, SystemAllocator)
 
 AZ_RTTI (AssetData, "{AF3F7D32-1536-422A-89F3-A11E1F5B5A9C}")
 
 AssetData (const AssetId &assetId=AssetId(), AssetStatus status=AssetStatus::NotLoaded)
 
void Acquire ()
 
void Release ()
 
void AcquireWeak ()
 
void ReleaseWeak ()
 
bool IsReady () const
 
bool IsError () const
 
bool IsLoading (bool includeQueued=true) const
 
AssetStatus GetStatus () const
 
const AssetIdGetId () const
 
AssetType GetType () const
 
int GetUseCount () const
 
int GetCreationToken () const
 

Static Public Member Functions

static const char * GetFileFilter ()
 
static constexpr u32 GetAssetSubId ()
 
- Static Public Member Functions inherited from AZ::Data::AssetData
static void Reflect (ReflectContext *context)
 

Protected Attributes

Entitym_entity
 Root entity that should contain only the slice component.
 
SliceComponentm_component
 Slice component for this asset.
 
bool m_ignoreNextAutoReload
 
- Protected Attributes inherited from AZ::Data::AssetData
AZStd::atomic_int m_useCount { 0 }
 
AZStd::atomic_int m_weakUseCount { 0 }
 
AZStd::atomic< AssetStatusm_status
 
AssetId m_assetId
 
AssetHandlerm_registeredHandler { nullptr }
 
int m_creationToken = s_defaultCreationToken
 
AZStd::bitset< 32 > m_flags
 

Friends

class SliceAssetHandler
 

Additional Inherited Members

- Public Types inherited from AZ::Data::AssetData
enum class  AssetStatus : int {
  NotLoaded , Queued , StreamReady , Loading ,
  LoadedPreReady , ReadyPreNotify , Ready , Error
}
 
- Protected Types inherited from AZ::Data::AssetData
enum class  AssetDataFlags : AZ::u32 { Requeue = 0 }
 
- Protected Member Functions inherited from AZ::Data::AssetData
virtual bool IsRegisterReadonlyAndShareable ()
 
virtual bool HandleAutoReload ()
 
bool GetFlag (const AssetDataFlags &checkFlag) const
 
void SetFlag (const AssetDataFlags &checkFlag, bool setValue)
 
bool GetRequeue () const
 
void SetRequeue (bool requeue)
 
void RegisterWithHandler (AssetHandler *assetHandler)
 
void UnregisterWithHandler ()
 
 AssetData (const AssetData &)=delete
 

Detailed Description

Represents a Slice asset.

Member Function Documentation

◆ HandleAutoReload()

bool AZ::SliceAsset::HandleAutoReload ( )
overridevirtual

Invoked by the AssetManager to determine if this SliceAsset data object should be reloaded when a change to the asset on disk is detected. Checks the state of m_ignoreNextAutoReload to determine this and sets m_ignoreNextAutoReload to false at the end. During a Create Slice operation in Editor the reload is prevented as we have already built the asset in memory and a reload is not needed.

Reimplemented from AZ::Data::AssetData.

◆ SetData()

bool AZ::SliceAsset::SetData ( Entity entity,
SliceComponent component,
bool  deleteExisting = true 
)

Overwrites the current asset data (if any) and set the asset ready (if not).

Parameters
deleteExistingdeletes the existing entity on set (if one exist)
Returns
true of data was set, or false if the asset is currently loading.

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