    #include "DeerStudio/EditorEngine/API.h"
    #include "DeerStudio/EditorEngine.h"
    #include "DeerStudio/EditorEngine/ErrorHandle.h"
    #include "DeerStudio/EditorEngine/API_Registration.h"

    #include "angelscript.h"

    namespace Deer {
        void EditorEngine::registerEditorEngineFunctions() {
            registerEntityFunctions();
            registerMathFunctions();
            registerUIFunctions();
            registerFrameBufferFunctions();
            registerEnvironmentFunctions();

            scriptEngine->SetDefaultNamespace("UI");
            REGISTER_GLOBAL_FUNC("void setupAutomaticColumns(int)", setupAutomaticColumns);
            REGISTER_GLOBAL_FUNC("void setupColumns(int)", setupColumns);
            REGISTER_GLOBAL_FUNC("void endColumns()", endColumns);
            REGISTER_GLOBAL_FUNC("void nextColumn()", nextColumn);
            scriptEngine->SetDefaultNamespace("");

            scriptEngine->SetDefaultNamespace("Resource");
            REGISTER_GLOBAL_FUNC("int getResourceCount(ResourceType, const string& in)", getResourceCount);
            REGISTER_GLOBAL_FUNC("string getResourceNameById(ResourceType, const string& in, int)", getResourceNameById);
            REGISTER_GLOBAL_FUNC("string getResourcePathById(ResourceType, const string& in, int)", getResourcePathById);
            REGISTER_GLOBAL_FUNC("int getDirCount(ResourceType, const string& in)", getDirCount);
            REGISTER_GLOBAL_FUNC("string getDirPathById(ResourceType, const string& in, int)", getDirPathById);
            REGISTER_GLOBAL_FUNC("string getDirNameById(ResourceType, const string& in, int)", getDirNameById);
            scriptEngine->SetDefaultNamespace("");

            scriptEngine->SetDefaultNamespace("Engine");
            REGISTER_GLOBAL_FUNC("void print(const string& in)", print);
            scriptEngine->SetDefaultNamespace("");

            scriptEngine->SetDefaultNamespace("UI");
            REGISTER_GLOBAL_FUNC("void treeNodeLeaf(const string& in, bool)", treeNode);
            REGISTER_GLOBAL_FUNC("bool treeNode(const string& in, bool, any@+, ReciverFunc@+)", treeNodeRecursive);
            REGISTER_GLOBAL_FUNC("bool componentNode(const string& in, any@+, ReciverFunc@+)", componentNode);
            REGISTER_GLOBAL_FUNC("bool componentNode_contextMenu(const string& in, any@+, ReciverFunc@+, ReciverFunc@+)", componentNode_contextMenu);
            REGISTER_GLOBAL_FUNC("void contextItemPopup(const string& in, any@+, ReciverFunc@+)", contextItemPopup);
            REGISTER_GLOBAL_FUNC("void contextMenuPopup(const string& in, any@+, ReciverFunc@+)", contextMenuPopup);
            REGISTER_GLOBAL_FUNC("void modalPopup(const string& in, ReciverFunc@+)", modalPopup);
            REGISTER_GLOBAL_FUNC("void simplePopup(const string& in, ReciverFunc@+)", simplePopup);
            REGISTER_GLOBAL_FUNC("void openPopup(const string& in, any@)", openPopup);
            REGISTER_GLOBAL_FUNC("void closePopup()", closePopup);
            REGISTER_GLOBAL_FUNC("void dragDropSource(const string& in, any@, const string& in)", dragDropSource);
            REGISTER_GLOBAL_FUNC("void dragDropTarget(const string& in, any@+, TransferFunc@+)", dragDropTarget);
            scriptEngine->SetDefaultNamespace("");
        }
    }