public BooleanKeyFrame GetKeyFrame(float frame) { BooleanKeyFrame key = null; int i; for (i = 0; i < Keys.Count; i++) { if (Keys[i].Frame == frame) { key = Keys[i]; break; } if (Keys[i].Frame > frame) { break; } } if (key == null) { key = new BooleanKeyFrame(); key.Frame = frame; Keys.Insert(i, key); } return(key); }
public bool SetBoolean(float Frame, bool Value) { for (int i = 0; i < Keys.Count; i++) { BooleanKeyFrame key = Keys[i]; if (key.Frame == Frame) { key.Visible = Value; return(true); } } return(false); }
public bool GetValue(float frame) { BooleanKeyFrame k1 = (BooleanKeyFrame)Keys[0], k2 = (BooleanKeyFrame)Keys[0]; int i = 0; if (frame < LastFrame) { LastFound = 0; } for (i = LastFound; i < Keys.Count; i++) { LastFound = i % (Keys.Count); BooleanKeyFrame k = Keys[LastFound]; if (k.Frame < frame) { k1 = k; } else { k2 = k; break; } } LastFound -= 1; if (LastFound < 0) { LastFound = 0; } if (LastFound >= Keys.Count - 2) { LastFound = 0; } LastFrame = frame; if (k1.InterType == InterpolationType.STEPBOOL) { return(k1.Visible); } return(k1.Visible); }