ScriptSystem.cpp 551 B

1234567891011121314151617181920212223242526272829
  1. #include "ScriptSystem.h"
  2. #include "ScriptComponent.h"
  3. #include "ScriptComponentFile.h"
  4. namespace Atomic
  5. {
  6. WeakPtr<Context> ScriptSystem::scriptContext_;
  7. void RegisterScriptLibrary(Context* context);
  8. ScriptSystem::ScriptSystem(Context* context) : Object(context)
  9. {
  10. RegisterScriptLibrary(context);
  11. scriptContext_ = context;
  12. }
  13. ScriptSystem::~ScriptSystem()
  14. {
  15. scriptContext_ = nullptr;
  16. }
  17. void RegisterScriptLibrary(Context* context)
  18. {
  19. ScriptComponentFile::RegisterObject(context);
  20. ScriptComponent::RegisterObject(context);
  21. }
  22. }