void AssetDatabase::HandleProjectUnloaded(StringHash eventType, VariantMap& eventData)
{
    ResourceCache* cache = GetSubsystem<ResourceCache>();
    cache->RemoveResourceDir(GetCachePath());
    assets_.Clear();
    usedGUID_.Clear();
    project_ = 0;

    UnsubscribeFromEvent(E_FILECHANGED);
}
Example #2
0
void ToolSystem::CloseProject()
{
    if (project_.Null())
        return;

    SendEvent(E_PROJECTUNLOADED);

    ResourceCache* cache = GetSubsystem<ResourceCache>();

    String projectPath = project_->GetProjectPath();
    String resourcePath = project_->GetResourcePath();

    project_ = 0;

    cache->RemoveResourceDir(resourcePath);
    cache->RemoveResourceDir(projectPath);

    cache->ReleaseAllResources(true);

}