Fix index invalidation for effects.
This commit is contained in:
@@ -23,8 +23,16 @@ namespace Cryville.Crtr {
|
||||
_indexSrc = new PropSrc.Float(() => Index);
|
||||
_durationOp = new PropOp.Float(v => _duration = v);
|
||||
}
|
||||
public float Index { get; set; }
|
||||
static readonly int _var_index = IdentifierManager.SharedInstance.Request("index");
|
||||
private float m_index;
|
||||
public float Index {
|
||||
get { return m_index; }
|
||||
set {
|
||||
if (m_index == value) return;
|
||||
m_index = value;
|
||||
_indexSrc.Invalidate();
|
||||
}
|
||||
}
|
||||
internal static readonly int _VAR_INDEX = IdentifierManager.SharedInstance.Request("index");
|
||||
readonly PropSrc _indexSrc;
|
||||
double _startTime;
|
||||
float _duration;
|
||||
@@ -34,7 +42,7 @@ namespace Cryville.Crtr {
|
||||
_startTime = time;
|
||||
RootTransform.gameObject.SetActive(true);
|
||||
ChartPlayer.etor.ContextCascadeInsert();
|
||||
ChartPlayer.etor.ContextCascadeUpdate(_var_index, _indexSrc);
|
||||
ChartPlayer.etor.ContextCascadeUpdate(_VAR_INDEX, _indexSrc);
|
||||
ChartPlayer.etor.Evaluate(_durationOp, _def.duration);
|
||||
_skinContainer.MatchDynamic(this, 0);
|
||||
ChartPlayer.etor.ContextCascadeDiscard();
|
||||
@@ -60,7 +68,9 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
|
||||
public int CompareTo(EffectInstance other) {
|
||||
return EndTime.CompareTo(other.EndTime);
|
||||
int r = EndTime.CompareTo(other.EndTime);
|
||||
if (r != 0) return r;
|
||||
return GetHashCode().CompareTo(other.GetHashCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -59,6 +59,7 @@ namespace Cryville.Crtr {
|
||||
foreach (var e in effects) {
|
||||
var effect = e.Value;
|
||||
etor.ContextCascadeInsert();
|
||||
etor.ContextCascadeUpdate(EffectInstance._VAR_INDEX, PropSrc.Error);
|
||||
etor.Optimize(effect.duration);
|
||||
effect.elements.Optimize(etor);
|
||||
etor.ContextCascadeDiscard();
|
||||
|
Reference in New Issue
Block a user