Consolidate config parsing and parse layer value

This commit is contained in:
2020-06-19 21:44:43 -07:00
parent 7980ef4791
commit 533b1f1cf4
9 changed files with 255 additions and 80 deletions

View File

@ -1,4 +1,5 @@
using System;
using ConformalDecals.Util;
using UnityEngine;
namespace ConformalDecals.MaterialProperties {
@ -8,11 +9,11 @@ namespace ConformalDecals.MaterialProperties {
public override void ParseNode(ConfigNode node) {
base.ParseNode(node);
value = ParsePropertyFloat(node, "value", true, value);
ParseUtil.ParseFloatIndirect(ref value, node, "value");
}
public override void Modify(Material material) {
if (material == null) throw new ArgumentNullException("material cannot be null");
if (material == null) throw new ArgumentNullException(nameof(material));
material.SetFloat(_propertyID, value);
}