mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Texture inheritance for materials, also script access
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user