public void CloneObj(ref IGameObj obj, ref IGameObj cloneObj) { Dictionary <string, GameProperty> mPropSet = cloneObj.PropSets(); foreach (KeyValuePair <string, GameProperty> kvp in mPropSet) { string key = kvp.Key; obj.UpdateProperty(ref key, kvp.Value.propValue.Clone()); } VarList recordList = new VarList(); cloneObj.GetRecordList(ref recordList); int count = recordList.GetCount(); for (int i = 0; i < count; i++) { string recordName = recordList.GetString(i); GameRecord record = cloneObj.GetGameRecordByName(recordName).Clone(); obj.AddRecord2Set(recordName, ref record); } }