KSP-Conformal-Decals/Source/ConformalDecals/MaterialProperties/MaterialProperty.cs

25 lines
736 B
C#
Raw Normal View History

using System;
using UnityEngine;
2020-06-19 23:35:10 +00:00
namespace ConformalDecals.MaterialProperties {
public abstract class MaterialProperty : ScriptableObject {
2020-06-05 07:29:23 +00:00
public string PropertyName {
get => _propertyName;
set {
_propertyName = value;
_propertyID = Shader.PropertyToID(_propertyName);
}
}
[SerializeField] protected int _propertyID;
[SerializeField] protected string _propertyName;
public virtual void ParseNode(ConfigNode node) {
2020-06-06 20:20:50 +00:00
if (node == null) throw new ArgumentNullException(nameof(node));
2020-06-05 07:29:23 +00:00
PropertyName = node.GetValue("name");
}
public abstract void Modify(Material material);
}
}