Introduce IntKeyedDictionary to improve performance.

This commit is contained in:
2023-03-24 17:06:47 +08:00
parent 89f391f040
commit e2c683567e
18 changed files with 1274 additions and 94 deletions

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using Cryville.Common.Collections.Specialized;
using UnityEngine;
namespace Cryville.Crtr {
@@ -6,11 +6,11 @@ namespace Cryville.Crtr {
public int Name { get; private set; }
public Transform Transform { get; private set; }
public SkinContext SkinContext { get; private set; }
public Dictionary<int, PropSrc> PropSrcs { get; private set; }
public IntKeyedDictionary<PropSrc> PropSrcs { get; private set; }
public Anchor(int name, Transform transform, int propSrcCount = 0) {
Name = name;
Transform = transform;
if (propSrcCount > 0) PropSrcs = new Dictionary<int, PropSrc>(propSrcCount);
if (propSrcCount > 0) PropSrcs = new IntKeyedDictionary<PropSrc>(propSrcCount);
SkinContext = new SkinContext(transform, PropSrcs);
}
}