Editor API
UnigineEditor public API
AssetManager.h
1 // Copyright (C), UNIGINE. All rights reserved.
2 #pragma once
3 
4 
5 #include <EditorGlobal.h>
6 
7 #include <UnigineBase.h>
8 #include <UnigineGUID.h>
9 
10 #include <QObject>
11 #include <QVector>
12 
13 
15 // Forward decl.
17 namespace Editor { class Application; }
18 
19 
20 namespace Editor
21 {
23 // AssetManager.
30 class EDITOR_API AssetManager final : public QObject
31 {
32  Q_OBJECT
33 public:
42  static AssetManager *instance();
47  static bool hasAsset(const Unigine::UGUID &guid);
52  static bool hasAsset(const QString &s_filepath);
54  static QVector<Unigine::UGUID> assets();
57  static QVector<Unigine::UGUID> assets(const QString &dirpath);
60  static QString assetFilePath(const Unigine::UGUID &guid);
61 
62 signals:
66  void added(const Unigine::UGUID &guid);
70  void removed(const Unigine::UGUID &guid);
74  void changed(const Unigine::UGUID &guid);
78  void moved(const Unigine::UGUID &guid);
79 
80 private:
81  AssetManager(QObject *parent = nullptr);
82  ~AssetManager() override;
83 
84  friend class Editor::Application;
85 };
86 
87 
88 } // namespace Editor
Definition: Actions.h:9
This class is used to manage assets in the Editor. You can check if an asset with the specified GUID ...
Definition: AssetManager.h:30