Simplify model cache setting
This commit is contained in:
parent
0b347f7745
commit
74bde133bb
|
@ -33,15 +33,7 @@ public class ModelLoader
|
|||
|
||||
// We don't care if this is null actually, we'll still cache that it's null lol
|
||||
var model = LoadModel(_pathManager, ref campaignName, modelName);
|
||||
var key = (campaignName, modelName);
|
||||
if (_cache.ContainsKey(key))
|
||||
{
|
||||
_cache[key] = model;
|
||||
}
|
||||
else
|
||||
{
|
||||
_cache.TryAdd(key, model);
|
||||
}
|
||||
_cache[(campaignName, modelName)] = model;
|
||||
return model == null ? model : model.Duplicate() as MeshInstance3D;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue