Editor API
UnigineEditor public API
AssetManager.h
1 // Copyright (C), UNIGINE. All rights reserved.
2 #pragma once
3 
4 
5 #include <editor/EditorGlobal.h>
6 
7 #include <UnigineBase.h>
8 #include <UnigineGUID.h>
9 #include <UnigineString.h>
10 #include <UnigineVector.h>
11 
12 #include <QObject>
13 
14 
16 // Forward decl.
18 namespace Editor { class Application; }
19 
20 
21 namespace Editor
22 {
24 // AssetManager.
31 class EDITOR_API AssetManager final : public QObject
32 {
33  Q_OBJECT
34 public:
43  static AssetManager *instance();
48  static bool hasAsset(const Unigine::UGUID &guid);
53  static bool hasAsset(const char *s_filepath);
55  static Unigine::Vector<Unigine::UGUID> assets();
58  static Unigine::Vector<Unigine::UGUID> assets(const char *dirpath);
61  static Unigine::String assetFilePath(const Unigine::UGUID &guid);
62 
63 signals:
67  void added(const Unigine::UGUID &guid);
71  void removed(const Unigine::UGUID &guid);
75  void changed(const Unigine::UGUID &guid);
79  void moved(const Unigine::UGUID &guid);
80 
81 private:
82  AssetManager(QObject *parent = nullptr);
83  ~AssetManager() override;
84 
85  friend class Editor::Application;
86 };
87 
88 
89 } // namespace Editor
Definition: Actions.h:11
This class is used to manage assets in the Editor. You can check if an asset with the specified GUID ...
Definition: AssetManager.h:31