mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Serialize Mesh and MeshRenderer in scene + fixed Light serialization
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -268,10 +268,10 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
StringView path = .((char8*)payload.Data, (int)payload.DataSize);
|
||||
|
||||
Texture2D texture = Content.LoadAsset<Texture2D>(path);//new Texture2D(path, true);
|
||||
|
||||
spriteRendererComponent.Sprite?.ReleaseRef();
|
||||
spriteRendererComponent.Sprite = texture;
|
||||
using (Texture2D texture = Content.LoadAsset<Texture2D>(path))
|
||||
{
|
||||
spriteRendererComponent.Sprite = texture;
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.EndDragDropTarget();
|
||||
|
||||
Reference in New Issue
Block a user