You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KSP-Conformal-Decals/Source/ConformalDecals/MaterialProperties/MaterialColorProperty.cs

21 lines
640 B
C#

using System;
using ConformalDecals.Util;
using UnityEngine;
namespace ConformalDecals.MaterialProperties {
public class MaterialColorProperty : MaterialProperty {
[SerializeField] public Color32 color = new Color32(0, 0, 0, byte.MaxValue);
public override void ParseNode(ConfigNode node) {
base.ParseNode(node);
ParseUtil.ParseColor32Indirect(ref color, node, "color");
}
public override void Modify(Material material) {
if (material == null) throw new ArgumentNullException(nameof(material));
material.SetColor(_propertyID, color);
}
}
}