// copy properties from key public override AMKey CreateClone() { AMEventKey a = ScriptableObject.CreateInstance <AMEventKey>(); a.frame = frame; a.component = component; a.useSendMessage = useSendMessage; // parameters a.methodName = methodName; a.methodInfo = methodInfo; foreach (AMEventParameter e in parameters) { a.parameters.Add(e.CreateClone()); } return(a); }
// add a new key public void addKey(int _frame) { foreach (AMEventKey key in keys) { // if key exists on frame, do nothing if (key.frame == _frame) { return; } } AMEventKey a = ScriptableObject.CreateInstance <AMEventKey> (); a.frame = _frame; a.component = null; a.methodName = null; a.parameters = null; // add a new key keys.Add(a); // update cache updateCache(); }