Code cleanup with the implementation of property store.
This commit is contained in:
@@ -453,19 +453,16 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
}
|
||||
}
|
||||
static float _ttime;
|
||||
static Vector4 _trans;
|
||||
static readonly PropSrc _ttimesrc = new PropSrc.Float(() => _ttime);
|
||||
static readonly PropOp _transop = new PropOp.Vector4(v => _trans = v);
|
||||
static readonly PropStores.Float _ttimest = new PropStores.Float();
|
||||
static readonly PropStores.Vector4 _transst = new PropStores.Vector4();
|
||||
Vector4 GetTransition(float time, PdtExpression transition) {
|
||||
if (time >= 1) return Vector4.one;
|
||||
if (transition == null) return new Vector4(time, time, time, time);
|
||||
_ttime = time;
|
||||
_ttimesrc.Invalidate();
|
||||
PdtEvaluator.Instance.ContextSelfValue = _ttimesrc;
|
||||
PdtEvaluator.Instance.Evaluate(_transop, transition);
|
||||
_ttimest.Value = time;
|
||||
PdtEvaluator.Instance.ContextSelfValue = _ttimest.Source;
|
||||
PdtEvaluator.Instance.Evaluate(_transst.Target, transition);
|
||||
PdtEvaluator.Instance.ContextSelfValue = null;
|
||||
return _trans;
|
||||
return _transst.Value;
|
||||
}
|
||||
|
||||
public void BroadcastPreInit() {
|
||||
|
Reference in New Issue
Block a user