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/MaterialProperty.cs

26 lines
805 B
C#

using System;
using UnityEngine;
namespace ConformalDecals.MaterialProperties {
public abstract class MaterialProperty : ScriptableObject {
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) {
if (node == null) throw new ArgumentNullException(nameof(node));
PropertyName = node.GetValue("name");
Debug.Log($"Parsing material property {_propertyName}");
}
public abstract void Modify(Material material);
}
}