Texture inheritance for materials, also script access

This commit is contained in:
Simon Lübeß
2025-03-01 00:03:38 +01:00
parent 824c19c0b2
commit b5088329f5
13 changed files with 470 additions and 82 deletions
+22
View File
@@ -1,4 +1,5 @@
using System.Diagnostics.SymbolStore;
using GlitchyEngine.Core;
using GlitchyEngine.Math;
namespace GlitchyEngine.Graphics;
@@ -20,4 +21,25 @@ public class Material : Asset
{
ScriptGlue.Material_ResetVariable(_uuid, name);
}
public void SetTexture(string name, Texture? texture)
{
ScriptGlue.Material_SetTexture(_uuid, name, texture?._uuid ?? UUID.Zero);
}
public Texture? GetTexture(string name)
{
ScriptGlue.Material_GetTexture(_uuid, name, out UUID textureId);
// TODO: Support different texture types?
return new Texture
{
_uuid = textureId
};
}
public void ResetTexture(string name)
{
ScriptGlue.Material_ResetTexture(_uuid, name);
}
}