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,4 @@
using Cryville.Common.Pdt;
using Cryville.Common.Pdt;
using Cryville.Crtr.Components;
using Cryville.Crtr.Event;
using System;
@@ -35,7 +35,7 @@ namespace Cryville.Crtr {
void MatchStatic(SkinElement rel, ContainerState context, Transform anchor = null) {
ChartPlayer.etor.ContextTransform = anchor;
foreach (var p in rel.properties) {
if (p.Key.Name == null)
if (p.Key.Name == 0)
anchor.gameObject.AddComponent(p.Key.Component);
else {
ChartPlayer.etor.Evaluate(GetPropOp(anchor, p.Key).Operator, p.Value);
@@ -82,7 +82,7 @@ namespace Cryville.Crtr {
void MatchDynamic(SkinElement rel, ContainerState context, Transform anchor = null) {
ChartPlayer.etor.ContextTransform = anchor;
foreach (var p in rel.properties) {
if (p.Key.Name == null)
if (p.Key.Name == 0)
throw new InvalidOperationException("Component creation in dynamic context is not allowed");
var prop = GetPropOp(anchor, p.Key);
if (context.CloneType > prop.UpdateCloneType) continue;