using Cryville.Common; using Cryville.Common.Collections.Specialized; using Cryville.Common.Pdt; using UnityEngine; namespace Cryville.Crtr.Components { public abstract class SkinComponent : MonoBehaviour { /// /// The property operators of the component. /// public IntKeyedDictionary Properties { get; private set; } /// /// Submits a property. /// /// The name of the property. /// The property. protected void SubmitProperty(string name, PdtOperator property, int udl = 0) { Properties.Add(IdentifierManager.SharedInstance.Request(name), new SkinProperty(property, udl)); } /// /// Creates a skin component. /// protected SkinComponent() { Properties = new IntKeyedDictionary(); } 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; } } }