Start of inheriting Materials, create material instance for getMaterial from scripts

This commit is contained in:
Simon Lübeß
2025-02-14 12:39:35 +01:00
parent aaed4199d3
commit 24295731f3
6 changed files with 66 additions and 17 deletions
+9
View File
@@ -25,4 +25,13 @@ public abstract class EngineObject
{
_uuid = uuid;
}
/// <summary>Determines whether the specified <see cref="EngineObject"/> is equal to the current <see cref="EngineObject"/>.</summary>
/// <param name="other">The object to compare with the current object.</param>
/// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
public bool Equals(EngineObject other)
{
// TODO: Are we really only interested in what equates to reference equality on the engine side?
return _uuid == other._uuid;
}
}
+3
View File
@@ -3,6 +3,9 @@ using GlitchyEngine.Math;
namespace GlitchyEngine.Graphics;
/// <summary>
/// An <see cref="Asset"/> that represents how a surface should be rendered.
/// </summary>
public class Material : Asset
{
public void SetVariable(string name, float4 value)
+4
View File
@@ -10,6 +10,10 @@ 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
+4
View File
@@ -39,6 +39,10 @@ public class SpriteRenderer : Component
/// <summary>
/// Gets or sets the Material of this SpriteRenderer.
/// </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