Luna::Asset::get_asset_data

template <typename _Ty>
Ref< _Ty > get_asset_data(asset_t asset)

Gets the asset data object.

Parameters

  • in asset

    The asset handle of the asset to query.

  • in block_until_loaded

    If the asset is not loaded and this is true, this call blocks the current thread until the asset data is loaded, then returns the loaded asset data. Note that this may cause application freeze if improperly used.

Return value

Returns the asset data, or nullptr if the asset data is not loaded or failed to load.