gets reloaded?
I think what reloading it’s internal operation (see: bool ResourceCache::ReloadResource(Resource* resource)) it “inspirited to move” by FileWatchers, and you have the same seriazible component (or whatever) with new update data by the same pointer as before. The pointer maybe as raw and also as shared…
Perhaps a verion of ResourceCache::GetResource() that uses StringHash name instead of String?
resources actually already are stored by hashed names, this string name converts to StringHash little deeper
Resource* ResourceCache::GetResource(StringHash type, const String& nameIn, bool sendEventOnFailure)
{
String name = SanitateResourceName(nameIn);
if (!Thread::IsMainThread())
{
URHO3D_LOGERROR("Attempted to get resource " + name + " from outside the main thread");
return 0;
}
// If empty name, return null pointer immediately
if (name.Empty())
return 0;
StringHash nameHash(name);
then it get res like this:
const SharedPtr& existing = FindResource(type, nameHash);