MCPcopy Create free account
hub / github.com/AmelieHeinrich/Termina / Update

Method Update

Sources/Termina/Scripting/ScriptSystem.cpp:75–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73 }
74
75 void ScriptSystem::Update(float deltaTime)
76 {
77#if defined(TRMN_DEBUG)
78 // Execute reload at start of frame (priority -1 ensures we run before WorldSystem)
79 // so no component list is being iterated when we add/remove components.
80 if (m_PendingReload) {
81 m_PendingReload = false;
82 if (!Compile()) {
83 TN_ERROR("Failed to compile scripts");
84 RebuildWatches();
85 return;
86 } else {
87 World* world = Application::GetSystem<WorldSystem>()->GetCurrentWorld();
88 ScriptModuleManager::Get().Reload("Game", world);
89 RebuildWatches();
90 return;
91 }
92 }
93
94 for (const auto& watch : m_Watches) {
95 if (FileSystem::HasFileChanged(watch)) {
96 m_PendingReload = true;
97 return;
98 }
99 }
100#endif
101 }
102
103 void ScriptSystem::ShowDebugWindow(bool* open)
104 {

Callers

nothing calls this directly

Calls 2

GetCurrentWorldMethod · 0.80
ReloadMethod · 0.80

Tested by

no test coverage detected