2020-05-27 06:04:19 +00:00
|
|
|
using System;
|
|
|
|
using UnityEngine;
|
|
|
|
|
2020-06-19 23:35:10 +00:00
|
|
|
namespace ConformalDecals.MaterialProperties {
|
2020-06-02 07:53:17 +00:00
|
|
|
public class MaterialColorProperty : MaterialProperty {
|
2020-06-04 07:12:09 +00:00
|
|
|
[SerializeField] public Color color;
|
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
|
|
|
color = ParsePropertyColor(node, "color", true, color);
|
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.SetColor(_propertyID, color);
|
2020-05-27 06:04:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|