public static AudioNode Duplicate(AudioNode audioNode) { return(NodeWorker.DuplicateHierarchy(audioNode, (@oldNode, newNode) => { newNode.NodeData = audioNode.gameObject.AddComponent(newNode.NodeData.GetType()) as NodeTypeData; EditorUtility.CopySerialized(oldNode.NodeData, newNode.NodeData); })); }
public static AudioEvent Duplicate(AudioEvent audioEvent) { return(NodeWorker.DuplicateHierarchy(audioEvent, (@oldNode, newNode) => { newNode.ActionList.Clear(); for (int i = 0; i < oldNode.ActionList.Count; i++) { newNode.ActionList.Add(NodeWorker.CopyComponent(oldNode.ActionList[i])); } })); }