mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
28 lines
846 B
C#
28 lines
846 B
C#
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>
|
|
/// <remarks>
|
|
/// If you get the <see cref="Material"/> and it is not yet a runtime-instance,
|
|
/// a new runtime-instance will be created and returned in its place.
|
|
/// </remarks>
|
|
public Material Material
|
|
{
|
|
get
|
|
{
|
|
ScriptGlue.MeshRenderer_GetMaterial(_uuid, out UUID materialHandle);
|
|
|
|
return new Material { _uuid = materialHandle };
|
|
}
|
|
set => ScriptGlue.MeshRenderer_SetMaterial(_uuid, value._uuid);
|
|
}
|
|
}
|