Unity-like asset database for editor tools.
More...
#include <AssetDatabase.h>
|
| static void | Initialize (AssetPipeline *pipeline) |
| | Initialize with pipeline (called by EditorApp at startup).
|
| static void | Shutdown () |
| | Shutdown (called by EditorApp at exit).
|
| static void | ImportAsset (const std::string &path) |
| | Import/reimport a specific asset.
|
| static void | Refresh () |
| | Refresh all changed assets.
|
| static std::string | AssetPathToGUID (const std::string &path) |
| | Get GUID for an asset path.
|
| static std::string | GUIDToAssetPath (const std::string &guid) |
| | Get asset path from GUID.
|
| static std::string | GUIDToAbsolutePath (const std::string &guid) |
| | Get absolute asset path from GUID.
|
| static const SubAssetInfo * | GetSubAsset (const std::string &guid) |
| | Get sub-asset info by GUID.
|
| static const std::vector< SubAssetInfo > * | GetSubAssets (const std::string &parentGuid) |
| | Get all sub-assets for a parent asset.
|
| static void | GetSpritesheetAssets (std::vector< std::pair< std::string, std::string > > &outAssets) |
| | Get all texture assets with sub-assets (spritesheets).
|
Unity-like asset database for editor tools.
Provides static methods for importing assets and GUID lookups. Tools call these directly without needing to know about AssetPipeline.
Usage: DekiEditor::AssetDatabase::ImportAsset("assets/sprites/player.png"); std::string guid = DekiEditor::AssetDatabase::AssetPathToGUID("assets/sprites/player.png");
◆ Initialize()
| void DekiEditor::AssetDatabase::Initialize |
( |
AssetPipeline * | pipeline | ) |
|
|
static |
Initialize with pipeline (called by EditorApp at startup).
◆ Shutdown()
| void DekiEditor::AssetDatabase::Shutdown |
( |
| ) |
|
|
static |
Shutdown (called by EditorApp at exit).
◆ ImportAsset()
| void DekiEditor::AssetDatabase::ImportAsset |
( |
const std::string & | path | ) |
|
|
static |
Import/reimport a specific asset.
- Parameters
-
| path | Project-relative path (e.g., "assets/sprites/player.png") |
Triggers cache rebuild for the asset.
◆ Refresh()
| void DekiEditor::AssetDatabase::Refresh |
( |
| ) |
|
|
static |
Refresh all changed assets.
Scans for modified files and reimports them.
◆ AssetPathToGUID()
| std::string DekiEditor::AssetDatabase::AssetPathToGUID |
( |
const std::string & | path | ) |
|
|
static |
Get GUID for an asset path.
- Parameters
-
| path | Project-relative path |
- Returns
- Asset GUID, or empty string if not found
◆ GUIDToAssetPath()
| std::string DekiEditor::AssetDatabase::GUIDToAssetPath |
( |
const std::string & | guid | ) |
|
|
static |
Get asset path from GUID.
- Parameters
-
- Returns
- Project-relative path, or empty string if not found
◆ GUIDToAbsolutePath()
| std::string DekiEditor::AssetDatabase::GUIDToAbsolutePath |
( |
const std::string & | guid | ) |
|
|
static |
Get absolute asset path from GUID.
- Parameters
-
- Returns
- Absolute path, or empty string if not found
◆ GetSubAsset()
| const SubAssetInfo * DekiEditor::AssetDatabase::GetSubAsset |
( |
const std::string & | guid | ) |
|
|
static |
Get sub-asset info by GUID.
- Parameters
-
- Returns
- Pointer to SubAssetInfo or nullptr
◆ GetSubAssets()
| const std::vector< SubAssetInfo > * DekiEditor::AssetDatabase::GetSubAssets |
( |
const std::string & | parentGuid | ) |
|
|
static |
Get all sub-assets for a parent asset.
- Parameters
-
| parentGuid | Parent asset's GUID |
- Returns
- Pointer to vector of sub-assets, or nullptr if parent has no sub-assets
◆ GetSpritesheetAssets()
| void DekiEditor::AssetDatabase::GetSpritesheetAssets |
( |
std::vector< std::pair< std::string, std::string > > & | outAssets | ) |
|
|
static |
Get all texture assets with sub-assets (spritesheets).
- Parameters
-
| outAssets | Vector to populate with texture assets that have sub-assets |
The documentation for this class was generated from the following file: