Interact with Materials from scripts

This commit is contained in:
Simon Lübeß
2025-02-14 11:54:07 +01:00
parent e5437c6ff6
commit aaed4199d3
24 changed files with 739 additions and 64 deletions
+23
View File
@@ -0,0 +1,23 @@
using GlitchyEngine.Core;
namespace GlitchyEngine.Graphics;
/// <summary>
/// Renders a Mesh. The Mesh can be specified by adding a <see cref="Mesh"/> component to the same <see cref="Entity"/>.
/// </summary>
public class MeshRenderer : Component
{
/// <summary>
/// Gets or sets the Material of this <see cref="MeshRenderer"/>.
/// </summary>
public Material Material
{
get
{
ScriptGlue.MeshRenderer_GetMaterial(_uuid, out UUID materialHandle);
return new Material { _uuid = materialHandle };
}
set => ScriptGlue.MeshRenderer_SetMaterial(_uuid, value._uuid);
}
}