2020-05-27 06:04:19 +00:00
|
|
|
using System;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace ConformalDecals.MaterialModifiers {
|
2020-06-02 07:53:17 +00:00
|
|
|
public class MaterialFloatProperty : MaterialProperty {
|
2020-06-04 07:12:09 +00:00
|
|
|
[SerializeField] public float value;
|
2020-05-27 06:04:19 +00:00
|
|
|
|
2020-06-04 07:12:09 +00:00
|
|
|
public override void ParseNode(ConfigNode node) {
|
|
|
|
base.ParseNode(node);
|
2020-05-27 06:04:19 +00:00
|
|
|
|
2020-06-04 07:12:09 +00:00
|
|
|
value = ParsePropertyFloat(node, "value", true, value);
|
2020-06-03 00:11:38 +00:00
|
|
|
}
|
|
|
|
|
2020-05-27 06:04:19 +00:00
|
|
|
public override void Modify(Material material) {
|
2020-06-04 07:12:09 +00:00
|
|
|
if (material == null) throw new ArgumentNullException("material cannot be null");
|
|
|
|
|
|
|
|
material.SetFloat(_propertyID, value);
|
2020-05-27 06:04:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|