mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
27 lines
795 B
C#
27 lines
795 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 abstract void Modify(Material material);
|
|
|
|
public virtual void ParseNode(ConfigNode node) {
|
|
if (node == null) throw new ArgumentNullException(nameof(node));
|
|
|
|
PropertyName = node.GetValue("name");
|
|
}
|
|
|
|
public virtual void Remove(Material material) { }
|
|
}
|
|
} |