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
|
// 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 model = LoadModel(_pathManager, ref campaignName, modelName);
|
||||||
var key = (campaignName, modelName);
|
_cache[(campaignName, modelName)] = model;
|
||||||
if (_cache.ContainsKey(key))
|
|
||||||
{
|
|
||||||
_cache[key] = model;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_cache.TryAdd(key, model);
|
|
||||||
}
|
|
||||||
return model == null ? model : model.Duplicate() as MeshInstance3D;
|
return model == null ? model : model.Duplicate() as MeshInstance3D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue