Open 3D Engine AzFramework 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.
AzFramework::GenericAssetHandlerBase Class Reference

#include <GenericAssetHandler.h>

Inherits AZ::Data::AssetHandler.

Inherited by AzFramework::GenericAssetHandler< AssetType >.

Public Member Functions

 AZ_RTTI (GenericAssetHandlerBase, "{B153B8B5-25CC-4BB7-A2BD-9A47ECF4123C}", AZ::Data::AssetHandler)
 

Detailed Description

Generic implementation of an asset handler for any arbitrary type that is reflected for serialization.

Simple or game specific assets that wish to make use of automated loading and editing facilities can use this handler with any asset type that's reflected for editing.

Example:

class MyAsset : public AZ::Data::AssetData { public: AZ_CLASS_ALLOCATOR(MyAsset, AZ::SystemAllocator); AZ_RTTI(MyAsset, "{AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}", AZ::Data::AssetData);

static void Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context); if (serialize) { serialize->Class<MyAsset>() ->Field("SomeField", &MyAsset::m_someField) ;

AZ::EditContext* edit = serialize->GetEditContext(); if (edit) { edit->Class<MyAsset>("My Asset", "Asset for representing X, Y, and Z") ->DataElement(0, &MyAsset::m_someField, "Some data field", "It's a float") ; } } }

float m_someField; };

using MyAssetHandler = GenericAssetHandler<MyAsset>; Just a base class to assign concrete RTTI to these classes - Don't derive from this - use GenericAssetHandler<T> instead. This being in the heirarchy allows you to easily ask whether a particular handler derives from this type and thus is a GenericAssetHandler.


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