mirror of
https://github.com/PorktoberRevolution/ReStocked
synced 2024-09-01 17:34:42 +00:00
23 lines
594 B
C#
23 lines
594 B
C#
|
using System;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace Restock.MaterialModifiers
|
|||
|
{
|
|||
|
public class ColorPropertyMaterialModifier : IMaterialModifier
|
|||
|
{
|
|||
|
private readonly string propertyName;
|
|||
|
private readonly Color color;
|
|||
|
|
|||
|
public ColorPropertyMaterialModifier(string propertyName, Color color)
|
|||
|
{
|
|||
|
this.propertyName = propertyName ?? throw new ArgumentNullException(nameof(propertyName));
|
|||
|
this.color = color;
|
|||
|
}
|
|||
|
|
|||
|
public void Modify(Material material)
|
|||
|
{
|
|||
|
material.SetColor(propertyName, color);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|