Created
September 15, 2016 00:09
-
-
Save terryjsmith/c454424e0db892b92a553d2db3b91161 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
void ScriptSystem::Update(float delta) { | |
// Global updates | |
ScriptTime::SetDelta(delta); | |
for(int i = 0; i < m_scriptablePoolSize; i++) { | |
if(m_scriptables[i]) { | |
// Set global script variables | |
m_currentObject = m_scriptables[i]; | |
Entity* obj = m_currentObject->GetParent(); | |
MeshInstance* instance = (MeshInstance*)obj->FindComponent<MeshInstance>(); | |
ScriptTransform::SetMeshInstance(instance); | |
// Execute script | |
Script* script = m_scriptables[i]->GetScript(); | |
script->Execute(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment