Editor API
UnigineEditor public API
Editor::AssetManager Class Referencefinal

This class is used to manage assets in the Editor. You can check if an asset with the specified GUID exists, get its file path, or subscribe for signals to perform certain actions when an asset is added, moved, updated, or deleted. More...

#include <AssetManager.h>

Inheritance diagram for Editor::AssetManager:

Signals

void added (const Unigine::UGUID &guid)
 This signal is emitted when a new asset is added, with the asset's GUID as an argument. More...
 
void removed (const Unigine::UGUID &guid)
 This signal is emitted when an asset is deleted, with the asset's GUID as an argument. More...
 
void changed (const Unigine::UGUID &guid)
 This signal is emitted when an asset is modified, with the asset's GUID as an argument. More...
 
void moved (const Unigine::UGUID &guid)
 This signal is emitted when an asset is moved to another location, with the asset's GUID as an argument. More...
 

Static Public Member Functions

static AssetManagerinstance ()
 Returns the instance of the AssetManager class. This method is used to subscribe to signals. More...
 
static bool hasAsset (const Unigine::UGUID &guid)
 Returns a value indicating whether an asset with the specified GUID exists. More...
 
static bool hasAsset (const QString &s_filepath)
 Returns a value indicating whether an asset with the specified file path exists. More...
 
static QVector< Unigine::UGUID > assets ()
 Returns the list of GUIDs for all existing assets. More...
 
static QVector< Unigine::UGUID > assets (const QString &dirpath)
 Returns the list of GUIDs for all assets existing in the specified directory. More...
 
static QString assetFilePath (const Unigine::UGUID &guid)
 Returns the path to the asset file by its GUID. More...
 

Friends

class Editor::Application
 

Detailed Description

This class is used to manage assets in the Editor. You can check if an asset with the specified GUID exists, get its file path, or subscribe for signals to perform certain actions when an asset is added, moved, updated, or deleted.

Member Function Documentation

◆ added

void Editor::AssetManager::added ( const Unigine::UGUID &  guid)
signal

This signal is emitted when a new asset is added, with the asset's GUID as an argument.

◆ assetFilePath()

static QString Editor::AssetManager::assetFilePath ( const Unigine::UGUID &  guid)
static

Returns the path to the asset file by its GUID.

Parameters
guidGUID of the asset to find the path for.

◆ assets() [1/2]

static QVector<Unigine::UGUID> Editor::AssetManager::assets ( )
static

Returns the list of GUIDs for all existing assets.

◆ assets() [2/2]

static QVector<Unigine::UGUID> Editor::AssetManager::assets ( const QString &  dirpath)
static

Returns the list of GUIDs for all assets existing in the specified directory.

Parameters
dirpathPath to a directory containing assets.

◆ changed

void Editor::AssetManager::changed ( const Unigine::UGUID &  guid)
signal

This signal is emitted when an asset is modified, with the asset's GUID as an argument.

◆ hasAsset() [1/2]

static bool Editor::AssetManager::hasAsset ( const Unigine::UGUID &  guid)
static

Returns a value indicating whether an asset with the specified GUID exists.

Parameters
guidGUID of the asset to be checked.

◆ hasAsset() [2/2]

static bool Editor::AssetManager::hasAsset ( const QString &  s_filepath)
static

Returns a value indicating whether an asset with the specified file path exists.

Parameters
s_filepathPath of the asset to be checked.

◆ instance()

static AssetManager* Editor::AssetManager::instance ( )
static

Returns the instance of the AssetManager class. This method is used to subscribe to signals.

Returns
AssetManager class instance.

Example:

, this, &SomeClass::asset_changed);

◆ moved

void Editor::AssetManager::moved ( const Unigine::UGUID &  guid)
signal

This signal is emitted when an asset is moved to another location, with the asset's GUID as an argument.

◆ removed

void Editor::AssetManager::removed ( const Unigine::UGUID &  guid)
signal

This signal is emitted when an asset is deleted, with the asset's GUID as an argument.

Friends And Related Function Documentation

◆ Editor::Application

friend class Editor::Application
friend