You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
594 B
C#
23 lines
594 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Restock.MaterialModifiers
|
|
{
|
|
public class FloatPropertyMaterialModifier : IMaterialModifier
|
|
{
|
|
private readonly string propertyName;
|
|
private readonly float value;
|
|
|
|
public FloatPropertyMaterialModifier(string propertyName, float value)
|
|
{
|
|
this.propertyName = propertyName ?? throw new ArgumentNullException(nameof(propertyName));
|
|
this.value = value;
|
|
}
|
|
|
|
public void Modify(Material material)
|
|
{
|
|
material.SetFloat(propertyName, value);
|
|
}
|
|
}
|
|
}
|