mirror of
https://github.com/PorktoberRevolution/ReStocked
synced 2024-09-01 17:34:42 +00:00
8d8795c57d
Allows float and color properties to be set on actual parts now, not just fairings
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);
|
|
}
|
|
}
|
|
}
|