using Cryville.Common.Pdt; using System; using System.Collections.Generic; using UnityEngine; namespace Cryville.Crtr.Components { public abstract class SkinComponent : MonoBehaviour { #if false /// /// The properties of the component. /// [Obsolete] public Dictionary Properties { get; private set; } /// /// Submits a property. /// /// The name of the property. /// The property itself. [Obsolete] protected void SubmitProperty(string name, Property property) { Properties.Add(name, property); } /// /// The property of a skin component. /// [Obsolete] public struct Property { /// /// The type of the property. /// public readonly Type Type; /// /// The callback that gets the property value. /// public readonly Func Get; /// /// The callback that sets the property value. /// public readonly Action Set; /// /// Creates a property. /// /// The type of the property. /// The callback that gets the property value. /// The callback that sets the property value. public Property(Type type, Func get, Action set) { Type = type; Get = get; Set = set; } } #endif /// /// The property operators of the component. /// public Dictionary PropOps { get; private set; } /// /// Submits a property. /// /// The name of the property. /// The property operator. protected void SubmitProperty(string name, PdtOperator property) { PropOps.Add(name, property); } /// /// Create a skin component /// protected SkinComponent() { // Properties = new Dictionary(); PropOps = new Dictionary(); } public virtual void Init() { } protected abstract void OnDestroy(); } }