I’m building an app that allows the user to load Script files (in my case, Angelscript) during runtime. This works fine, however, I’ve noticed that if the user changes the file on disk and reloads it, the system still uses a cached verison. My logic for loading the script file is pretty basic, so I’m probably missing something:
[code]//run the script if one is present
Script* script_engine = GetContext()->GetSubsystem();
ResourceCache* cache = GetContext()->GetSubsystem<ResourceCache>();
FileSystem* fs = GetContext()->GetSubsystem<FileSystem>();
ScriptFile* script_file = cache->GetResource<ScriptFile>(path);
if(script_file)
{
bool res = script_file->Execute("void CS_SCRIPT_START()");
if(!res)
script_file->Execute("void Start()");
if(!res)
URHO3D_LOGINFO("Could not start script file");
}[/code]
I know that there is a method that checks if the script is compiled or not, but I’m not sure how to force the compile to happen.