// update cache public override void updateCache(ITarget target) { base.updateCache(target); // add all clips to list for (int i = 0; i < keys.Count; i++) { GOSetActiveKey key = keys[i] as GOSetActiveKey; if (keys.Count > (i + 1)) { key.endFrame = keys[i + 1].frame; } else { key.endFrame = -1; } } }
// add a new key public void addKey(ITarget target, int _frame) { foreach (GOSetActiveKey key in keys) { // if key exists on frame, update if (key.frame == _frame) { key.setActive = true; updateCache(target); return; } } GOSetActiveKey a = new GOSetActiveKey(); a.frame = _frame; a.setActive = true; // add a new key keys.Add(a); // update cache updateCache(target); }