Fix editor scene persistence and XC scene workflow
This commit is contained in:
35
editor/src/ComponentEditors/IComponentEditor.h
Normal file
35
editor/src/ComponentEditors/IComponentEditor.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEngine/Components/Component.h>
|
||||
#include <XCEngine/Components/GameObject.h>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace Editor {
|
||||
|
||||
class IComponentEditor {
|
||||
public:
|
||||
virtual ~IComponentEditor() = default;
|
||||
|
||||
virtual const char* GetDisplayName() const = 0;
|
||||
virtual bool CanEdit(::XCEngine::Components::Component* component) const = 0;
|
||||
virtual bool Render(::XCEngine::Components::Component* component) = 0;
|
||||
|
||||
virtual bool ShowInAddComponentMenu() const { return true; }
|
||||
virtual bool CanAddTo(::XCEngine::Components::GameObject* gameObject) const { return false; }
|
||||
virtual const char* GetAddDisabledReason(::XCEngine::Components::GameObject* gameObject) const {
|
||||
(void)gameObject;
|
||||
return nullptr;
|
||||
}
|
||||
virtual ::XCEngine::Components::Component* AddTo(::XCEngine::Components::GameObject* gameObject) const {
|
||||
(void)gameObject;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual bool CanRemove(::XCEngine::Components::Component* component) const {
|
||||
(void)component;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Editor
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user