2020-05-27 06:04:19 +00:00
|
|
|
using System;
|
2020-06-20 04:44:43 +00:00
|
|
|
using ConformalDecals.Util;
|
2020-05-27 06:04:19 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
2020-06-19 23:35:10 +00:00
|
|
|
namespace ConformalDecals.MaterialProperties {
|
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-20 04:44:43 +00:00
|
|
|
ParseUtil.ParseFloatIndirect(ref value, node, "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-20 04:44:43 +00:00
|
|
|
if (material == null) throw new ArgumentNullException(nameof(material));
|
2020-06-04 07:12:09 +00:00
|
|
|
|
|
|
|
material.SetFloat(_propertyID, value);
|
2020-05-27 06:04:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|