Introduce IntKeyedDictionary
to improve performance.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Cryville.Common.Collections.Specialized;
|
||||
using Cryville.Common.Pdt;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -9,7 +10,7 @@ namespace Cryville.Crtr {
|
||||
readonly SkinElement _rootElement;
|
||||
readonly DynamicStack[] _stacks = new DynamicStack[2];
|
||||
readonly HashSet<SkinPropertyKey> _once = new HashSet<SkinPropertyKey>();
|
||||
public readonly Dictionary<int, SkinVariable> Variables = new Dictionary<int, SkinVariable>();
|
||||
public readonly IntKeyedDictionary<SkinVariable> Variables = new IntKeyedDictionary<SkinVariable>();
|
||||
|
||||
class DynamicStack {
|
||||
public readonly List<DynamicProperty> Properties = new List<DynamicProperty>();
|
||||
@@ -167,8 +168,8 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
public class SkinContext {
|
||||
public Transform Transform { get; private set; }
|
||||
public Dictionary<int, PropSrc> PropSrcs { get; private set; }
|
||||
public SkinContext(Transform transform, Dictionary<int, PropSrc> propSrcs = null) {
|
||||
public IReadOnlyDictionary<int, PropSrc> PropSrcs { get; private set; }
|
||||
public SkinContext(Transform transform, IReadOnlyDictionary<int, PropSrc> propSrcs = null) {
|
||||
Transform = transform;
|
||||
PropSrcs = propSrcs;
|
||||
}
|
||||
|
Reference in New Issue
Block a user