Serialize Mesh and MeshRenderer in scene + fixed Light serialization

This commit is contained in:
Simon Lübeß
2023-01-08 19:31:01 +01:00
parent b5ca86d8de
commit e38373dccf
8 changed files with 204 additions and 42 deletions
@@ -77,15 +77,16 @@ class MaterialAssetLoader : IAssetLoader //, IReloadingAssetLoader
for (let (slotName, textureIdentifier) in materialFile.Textures)
{
Texture texture = contentManager.LoadAsset(textureIdentifier) as Texture;
if (texture == null)
using (Texture texture = contentManager.LoadAsset(textureIdentifier) as Texture)
{
Log.EngineLogger.Error("Failed to load texture.");
// TODO: LoadAsset should return an error texture.
}
if (texture == null)
{
Log.EngineLogger.Error("Failed to load texture.");
// TODO: LoadAsset should return an error texture.
}
material.SetTexture(slotName, texture);
material.SetTexture(slotName, texture);
}
}
fx.ReleaseRef();