Files
crtr/Assets/Cryville/Crtr/Components/SkinComponent.cs

42 lines
1.3 KiB
C#

using Cryville.Common;
using Cryville.Common.Collections.Specialized;
using Cryville.Common.Pdt;
using UnityEngine;
namespace Cryville.Crtr.Components {
public abstract class SkinComponent : MonoBehaviour {
/// <summary>
/// The property operators of the component.
/// </summary>
public IntKeyedDictionary<SkinProperty> Properties { get; private set; }
/// <summary>
/// Submits a property.
/// </summary>
/// <param name="name">The name of the property.</param>
/// <param name="property">The property.</param>
protected void SubmitProperty(string name, PdtOperator property, int udl = 0) {
Properties.Add(IdentifierManager.SharedInstance.Request(name), new SkinProperty(property, udl));
}
/// <summary>
/// Creates a skin component.
/// </summary>
protected SkinComponent() {
Properties = new IntKeyedDictionary<SkinProperty>();
}
public virtual void Init() { }
public virtual void Rewind(double time, Transform target) { }
public virtual void Tick(SkinContainer c, double time) { }
protected abstract void OnDestroy();
}
public struct SkinProperty {
public PdtOperator Operator { get; set; }
public int UpdateDynamicLevel { get; set; }
public SkinProperty(PdtOperator op, int udl = 0) {
Operator = op;
UpdateDynamicLevel = udl;
}
}
}