Add more detailed model loading timings
This commit is contained in:
parent
8237a46989
commit
89cc70345e
|
@ -245,7 +245,7 @@ public partial class Mission : Node3D
|
||||||
var rawRot = brush.angle;
|
var rawRot = brush.angle;
|
||||||
var rot = new Vector3(rawRot.Y, rawRot.Z, rawRot.X) * 360 / ushort.MaxValue;
|
var rot = new Vector3(rawRot.Y, rawRot.Z, rawRot.X) * 360 / ushort.MaxValue;
|
||||||
var scale = scaleProp == null ? Vector3.One : scaleProp.scale.ToGodotVec3(false);
|
var scale = scaleProp == null ? Vector3.One : scaleProp.scale.ToGodotVec3(false);
|
||||||
var model = Timing.TimeStage("Load Models", () => { return _modelLoader.Load(_campaignName, modelName); });
|
var model = Timing.TimeStage("Get Models", () => { return _modelLoader.Load(_campaignName, modelName); });
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
model.Position = pos;
|
model.Position = pos;
|
||||||
|
|
|
@ -32,7 +32,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 = Timing.TimeStage("Load Models", () => { return LoadModel(_pathManager, ref campaignName, modelName); });
|
||||||
_cache[(campaignName, modelName)] = model;
|
_cache[(campaignName, modelName)] = model;
|
||||||
return model == null ? model : model.Duplicate() as MeshInstance3D;
|
return model == null ? model : model.Duplicate() as MeshInstance3D;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue