mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Interact with Materials from scripts
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user