Optimize performance for skin component properties.

This commit is contained in:
2022-12-20 16:04:35 +08:00
parent 207dee9932
commit 571320630b
3 changed files with 11 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
using Cryville.Common.Pdt;
using Cryville.Common;
using Cryville.Common.Pdt;
using System.Collections.Generic;
using UnityEngine;
@@ -7,21 +8,21 @@ namespace Cryville.Crtr.Components {
/// <summary>
/// The property operators of the component.
/// </summary>
public Dictionary<string, SkinProperty> Properties { get; private set; }
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 uct = 1) {
Properties.Add(name, new SkinProperty(property, uct));
Properties.Add(IdentifierManager.SharedInstance.Request(name), new SkinProperty(property, uct));
}
/// <summary>
/// Creates a skin component.
/// </summary>
protected SkinComponent() {
Properties = new Dictionary<string, SkinProperty>();
Properties = new Dictionary<int, SkinProperty>();
}
public virtual void Init() { }