private void DeleteNodes()
 {
     GraphUtility.RemoveNodes(this.m_Graph, this.m_Selection.ToArray());
     this.m_Selection.Clear();
     GraphUtility.Save(this.m_Graph);
     PrefabUtility.RecordPrefabInstancePropertyModifications(this.m_Target);
 }
Exemple #2
0
        private void CopyNodes()
        {
            Graph copy = new Graph();

            copy.serializationData = this.m_Graph.serializationData;
            for (int i = 0; i < this.m_Selection.Count; i++)
            {
                copy.serializationData.Replace(this.m_Selection[i].id, System.Guid.NewGuid().ToString());
            }
            GraphUtility.Load(copy);
            Node[] toDelete = copy.nodes.Where(x => !this.m_Selection.Exists(y => x.id == y.id)).ToArray();
            GraphUtility.RemoveNodes(copy, toDelete.Cast <FlowNode>().ToArray());
            GraphUtility.Save(copy);
            this.m_Copy = copy.serializationData;
        }