40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using Cryville.Common;
|
|
using Cryville.Common.Pdt;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Cryville.Crtr.Components {
|
|
public abstract class SkinComponent : MonoBehaviour {
|
|
/// <summary>
|
|
/// The property operators of the component.
|
|
/// </summary>
|
|
public Dictionary<int, 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 Dictionary<int, SkinProperty>();
|
|
}
|
|
|
|
public virtual void Init() { }
|
|
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;
|
|
}
|
|
}
|
|
}
|