using Cryville.Common; using Cryville.Common.Pdt; using System.Collections.Generic; using UnityEngine; namespace Cryville.Crtr.Components { public abstract class SkinComponent : MonoBehaviour { /// /// The property operators of the component. /// public Dictionary 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 Dictionary(); } public virtual void Init() { } public virtual void Rewind(double time) { } 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; } } }