diff --git a/Assets/Cryville/Crtr/InputProxy.cs b/Assets/Cryville/Crtr/InputProxy.cs index 295b709..825bddf 100644 --- a/Assets/Cryville/Crtr/InputProxy.cs +++ b/Assets/Cryville/Crtr/InputProxy.cs @@ -182,7 +182,6 @@ namespace Cryville.Crtr { readonly Dictionary _activeCounts = new Dictionary(); readonly Dictionary _vect = new Dictionary(); readonly Dictionary _vecs = new Dictionary(); - static readonly PropSrc.Arbitrary _nullsrc = new PropSrc.Arbitrary(PdtInternalType.Null, new byte[0]); double? _lockTime = null; unsafe void OnInput(InputIdentifier id, InputVector vec) { lock (_lock) { @@ -192,7 +191,7 @@ namespace Cryville.Crtr { float ft, tt = (float)(_lockTime != null ? _lockTime.Value : (vec.Time - _timeOrigins[id.Source.Handler])); if (!_vect.TryGetValue(id, out ft)) ft = tt; if (vec.IsNull) { - _etor.ContextCascadeUpdate(_var_value, _nullsrc); + _etor.ContextCascadeUpdate(_var_value, PropSrc.Null); OnInput(id, proxy.Target, ft, tt, true); } else { @@ -225,7 +224,7 @@ namespace Cryville.Crtr { else { var pid = new ProxiedInputIdentifier { Source = id, Target = target }; PropSrc fv, tv = _etor.ContextCascadeLookup(_var_value); - if (!_vecs.TryGetValue(pid, out fv)) fv = _nullsrc; + if (!_vecs.TryGetValue(pid, out fv)) fv = PropSrc.Null; if (fv.Type != PdtInternalType.Null || tv.Type != PdtInternalType.Null) { if (fv.Type == PdtInternalType.Null) _activeCounts[id.Source]++; _etor.ContextCascadeInsert(); diff --git a/Assets/Cryville/Crtr/PropSrc.cs b/Assets/Cryville/Crtr/PropSrc.cs index cb7e7dc..8e439df 100644 --- a/Assets/Cryville/Crtr/PropSrc.cs +++ b/Assets/Cryville/Crtr/PropSrc.cs @@ -54,6 +54,7 @@ namespace Cryville.Crtr { } } } + public static readonly PropSrc Null = new Arbitrary(PdtInternalType.Null, new byte[0]); public class String : PropSrc { readonly Func _cb; public String(Func cb) : base(PdtInternalType.String) { _cb = cb; }