-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New editor class registration & build script update
This commit registers the new editor classes to Godot's ClassDB and adds the plugins to the editor through a consolidated WwiseEditorPlugin helper class.
- Loading branch information
1 parent
5a7c1fa
commit e85ca2f
Showing
4 changed files
with
88 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#ifndef WWISE_EDITOR_MANAGER_H | ||
#define WWISE_EDITOR_MANAGER_H | ||
|
||
#include "editor/event_gizmo/ak_event_3d_gizmo_plugin.h" | ||
#include "editor/export_plugin/ak_editor_export_plugin.h" | ||
#include "editor/inspector_plugin/ak_inspector_plugin.h" | ||
#include <godot_cpp/classes/editor_plugin.hpp> | ||
#include <godot_cpp/classes/project_settings.hpp> | ||
|
||
namespace godot | ||
{ | ||
class WwiseEditorPlugin : public EditorPlugin | ||
{ | ||
GDCLASS(WwiseEditorPlugin, EditorPlugin); | ||
|
||
protected: | ||
static void _bind_methods() {} | ||
|
||
private: | ||
Ref<AkEvent3DGizmoPlugin> gizmo_plugin; | ||
Ref<AkEditorExportPlugin> export_plugin; | ||
Ref<AkInspectorEditorInspectorPlugin> inspector_plugin; | ||
|
||
public: | ||
virtual void _enter_tree() override | ||
{ | ||
if (!ProjectSettings::get_singleton()->has_setting("autoload/WwiseRuntimeManager")) | ||
{ | ||
add_autoload_singleton("WwiseRuntimeManager", "res://addons/Wwise/runtime/wwise_runtime_manager.gd"); | ||
} | ||
|
||
gizmo_plugin.instantiate(); | ||
add_node_3d_gizmo_plugin(gizmo_plugin); | ||
|
||
export_plugin.instantiate(); | ||
add_export_plugin(export_plugin); | ||
|
||
inspector_plugin.instantiate(); | ||
add_inspector_plugin(inspector_plugin); | ||
} | ||
|
||
virtual void _exit_tree() override | ||
{ | ||
remove_autoload_singleton("WwiseRuntimeManager"); | ||
remove_node_3d_gizmo_plugin(gizmo_plugin); | ||
remove_export_plugin(export_plugin); | ||
remove_inspector_plugin(inspector_plugin); | ||
} | ||
}; | ||
|
||
} //namespace godot | ||
|
||
#endif |