Editor API
UnigineEditor public API
AssetCreatorRegistry.h
1 // Copyright (C), UNIGINE. All rights reserved.
2 #pragma once
3 
4 #include <editor/EditorGlobal.h>
5 
6 #include <editor/MenuBase.h>
7 
8 #include <UnigineCallback.h>
9 
10 
11 namespace Editor
12 {
13 
15 {
16 public:
17  virtual const char *getVirtualDirectoryPath() const = 0;
18 
19 protected:
20  AssetCreateMenuContext() = default;
21  virtual ~AssetCreateMenuContext() = default;
22 };
23 
24 /*
25  * If you want to create assets, you are able to register a callback here to extend the 'Create'
26  * menu.
27  * It must be used on the main thread.
28  * The callback will be called on the main thread.
29  */
30 class EDITOR_API AssetCreatorRegistry final
31 {
32 public:
33  static void *addAssetCreateMenuExtender(
34  Unigine::CallbackBase2<MenuBase *, AssetCreateMenuContext *> *callback_to_extend_menu);
35  static bool removeAssetCreateMenuExtender(void *id);
36 };
37 
38 } // namespace Editor
Definition: Actions.h:11
Definition: AssetCreatorRegistry.h:14
Definition: AssetCreatorRegistry.h:30
virtual ~AssetCreateMenuContext()=default
virtual const char * getVirtualDirectoryPath() const =0